Hi, this should be an easy script but I don't know how to do basic math with Lua.
I want to count some items (herbs), and then divide them by 4. I basically want to split all my herbs into 4 piles.
Trigger to capture number of total herbs: (works fine)
The last count reached *
SetVariable ("herbcount", string.format ("%i", %1))
Note (GetVariable ("herbcount"))
Here's the script to divide: NOT working (I want to set the herbcount divided by 4 to a variable so that I can then send to the game "put X herb in backpack, drop X herb on ground" etc.
require "wait"
wait.make (function ()
Send ("count colocrasses")
wait.time (10)
SetVariable ("divided", (bc.div (Getvariable ("herbcount"), 4)))
Note (GetVariable ("divide"))
end)
So how do I go about dividing the variable "herbcount" by 4, and then setting that to a new variable "divided"? I know this must be easy.
I want to count some items (herbs), and then divide them by 4. I basically want to split all my herbs into 4 piles.
Trigger to capture number of total herbs: (works fine)
The last count reached *
SetVariable ("herbcount", string.format ("%i", %1))
Note (GetVariable ("herbcount"))
Here's the script to divide: NOT working (I want to set the herbcount divided by 4 to a variable so that I can then send to the game "put X herb in backpack, drop X herb on ground" etc.
require "wait"
wait.make (function ()
Send ("count colocrasses")
wait.time (10)
SetVariable ("divided", (bc.div (Getvariable ("herbcount"), 4)))
Note (GetVariable ("divide"))
end)
So how do I go about dividing the variable "herbcount" by 4, and then setting that to a new variable "divided"? I know this must be easy.