Hey i have a problem with the following script:
if (world.getvariable ("Plant_balance") = 1) then
if (world.getvariable ("Paralysis") = 1) then
world.send "eat bloodroot"
end if
if (world.getvariable ("Bloodroot_eaten") = 1) then
world.setvariable "Plant_balance", "0"
world.setvariable "Bloodrootcounter", Cint(getvariable("Bloodrootcounter")) -1
if (world.getvariable ("Bloodrootcounter") = 0) then
World.send "outr 5 bloodroot"
world.setvariable "Bloodrootcounter", "5"
end if
end if
if (world.getvariable ("Bloodroot_eaten") = 1) then
if (world.getvariable ("Paralysis_cured") = 0) then
world.setvariable "Paralysis", "0"
end if
end if
if (world.getvariable ("Paralysis_cured") = 1) then
world.setvariable "Paralysis", "0"
world.setvariable "Paralysis_cured", "0"
end if
world.setvariable "Bloodroot_eaten", "0"
end if
I should add some information to it.
In mushclient i have 5 variables, Plant_balance, Paralysis,
Paralysis_cured, Bloodrootcounter and Bloodroot_eaten.
This script is checked every time with a timer that checks if conditions ae true.
This script is triggered by a trigger which for example shows on my screen that i am paralyzed.
This trigger sets the variable Paralysis on 1.
Variable Plant_balance is standard 1 on the beginning.
The script goes off, the first couple of lines go well, until the line to send eat bloodroot to world.
When this is send, an ingame trigger goes off when i eat it, setting the variable Bloodroot_eaten to 1.
then the next lines i think it skips because the script runs to fast to change and immedeately check any values of variables.
Plant_balance is set to 0 if bloodroot_eaten is 1.
Bloodroot_counter is not of importance here in my question.
Ok what this script gives is when it is triggered, it sends the eat bloodroot to the world, then after the timer checks it again it eats another, this is not what its supposed to do heh, it probably skips some lines of script since the values are not yet appointed to the variables in Mushclient itself yet..
Whats wrong here..? what i want this piece of script to do is the following:
If it triggers it must send eat bloodroot to the world, this actually works fine. Then it has to test if this really happened, if it is shown on the screen, lag and stupidity affliction can hinder this.
If this is true, make Plant_balance = 0.
If this is true check if trigger has fired saying: You muscles unlock, you are no longer paralyzed (i have that one made into mushclient), this one makes Paralysis_cured = 1
if true set variable Paralysis = 0 and Paralysis_cured = 0
If bloodroot_eaten = 1 and Paralysis_cured is not 1 it has to set Paralysis = 0.
And a last it has to check the script piece again if the bloodroot was not eaten, this has to set plant_balance = 1 and should leave Paralysis = 1 also.
I think this is pretty much how i want it to work, sorry for the complicated imformation, but i am really stuck on this one.
Can anyone help me out with this?
Alot of thanks!
Aerath, Achaean player.
if (world.getvariable ("Plant_balance") = 1) then
if (world.getvariable ("Paralysis") = 1) then
world.send "eat bloodroot"
end if
if (world.getvariable ("Bloodroot_eaten") = 1) then
world.setvariable "Plant_balance", "0"
world.setvariable "Bloodrootcounter", Cint(getvariable("Bloodrootcounter")) -1
if (world.getvariable ("Bloodrootcounter") = 0) then
World.send "outr 5 bloodroot"
world.setvariable "Bloodrootcounter", "5"
end if
end if
if (world.getvariable ("Bloodroot_eaten") = 1) then
if (world.getvariable ("Paralysis_cured") = 0) then
world.setvariable "Paralysis", "0"
end if
end if
if (world.getvariable ("Paralysis_cured") = 1) then
world.setvariable "Paralysis", "0"
world.setvariable "Paralysis_cured", "0"
end if
world.setvariable "Bloodroot_eaten", "0"
end if
I should add some information to it.
In mushclient i have 5 variables, Plant_balance, Paralysis,
Paralysis_cured, Bloodrootcounter and Bloodroot_eaten.
This script is checked every time with a timer that checks if conditions ae true.
This script is triggered by a trigger which for example shows on my screen that i am paralyzed.
This trigger sets the variable Paralysis on 1.
Variable Plant_balance is standard 1 on the beginning.
The script goes off, the first couple of lines go well, until the line to send eat bloodroot to world.
When this is send, an ingame trigger goes off when i eat it, setting the variable Bloodroot_eaten to 1.
then the next lines i think it skips because the script runs to fast to change and immedeately check any values of variables.
Plant_balance is set to 0 if bloodroot_eaten is 1.
Bloodroot_counter is not of importance here in my question.
Ok what this script gives is when it is triggered, it sends the eat bloodroot to the world, then after the timer checks it again it eats another, this is not what its supposed to do heh, it probably skips some lines of script since the values are not yet appointed to the variables in Mushclient itself yet..
Whats wrong here..? what i want this piece of script to do is the following:
If it triggers it must send eat bloodroot to the world, this actually works fine. Then it has to test if this really happened, if it is shown on the screen, lag and stupidity affliction can hinder this.
If this is true, make Plant_balance = 0.
If this is true check if trigger has fired saying: You muscles unlock, you are no longer paralyzed (i have that one made into mushclient), this one makes Paralysis_cured = 1
if true set variable Paralysis = 0 and Paralysis_cured = 0
If bloodroot_eaten = 1 and Paralysis_cured is not 1 it has to set Paralysis = 0.
And a last it has to check the script piece again if the bloodroot was not eaten, this has to set plant_balance = 1 and should leave Paralysis = 1 also.
I think this is pretty much how i want it to work, sorry for the complicated imformation, but i am really stuck on this one.
Can anyone help me out with this?
Alot of thanks!
Aerath, Achaean player.