scn aaarecyclemanyshort itemcountshort quantityshort buttonshort stagefloat totalvaluefloat valueref itemBegin gamemode printc "Recycling Script Running." if ( stage == 0 ) amrecyclingchest.disable amrecyclingchest.moveto player 256 0 0 amrecyclingchest.enable set stage to 2 amrecyclingchest.activate player endif if ( stage == 2 ) let itemcount := amrecyclingchest.getnumitems - 1 while ( itemcount >= 0 ) let item := amrecyclingchest.getinventoryobject itemcount let value := amrecyclingchest.GetFullGoldValue item let quantity := amrecyclingchest.getitemcount item set value to value * quantity set totalvalue to totalvalue + value set itemcount to itemcount - 1 loop set stage to 3 endif if ( stage == 3 ) if ( button == 0 ) set totalvalue to ( totalvalue * aaaAdvancedMagecraftQST.RecycleGoldCost ) messagebox "Recycle items for %.0f Gold?" totalvalue "Yes" "Cancel" set button to -1 endif if ( button == -1 ) set button to getbuttonpressed endif printc "button %0.f" button if ( button == 0 ) printc "button 0" amrecyclingchest.removeallitems amrecyclingchest.disable amrecyclingchest.positioncell 0 0 0 0 aaaadvancedmagecraftholdingcell amrecyclingchest.enable player.additem gold001 totalvalue set stage to 0 return endif if ( button == 1 ) printc "button 1" amrecyclingchest.removeallitems player amrecyclingchest.disable amrecyclingchest.positioncell 0 0 0 0 aaaadvancedmagecraftholdingcell amrecyclingchest.enable set stage to 0 set button to 0 return endif endif stopquest aaaAMRecyclingQuest end
Seems the compiler doesn't like aaaAdvancedMagecraftQST.RecycleGoldCost in this script though, keeps telling me "unknown variable of function? Worked fine till I converted this to a quest script. What am I missing here??