Bloodrose Family Forums Archive


Public Board

-

Scripts

-

auto-harvester in mush

Poted by Kealiock on 12 Mar 2006 07:25 - auto-harvester in mush
ok.. i need help

herbs = world.getvariable "concoctions_herbs"
if herbs > 0 then world.send "harvest @concoctions_herb"


tells me what is wrong here

will post my final copy when its done
Poted by Indiana on 12 Mar 2006 07:28 -
Well, firs you didn't put an End If at the end (assuming that's VBScript), second, make sure you check the box "Expand Variables" ..  oh yeah, you also didn't use () for parameters of GetVariables.

Something like:
herbs = world.getvariable ("concoctions_herbs"

should do.
Poted by Kealiock on 12 Mar 2006 07:28 -
wow... im dum sometimes
Poted by Avian on 12 Mar 2006 07:31 -
Sometimes?
Poted by Kealiock on 12 Mar 2006 07:35 -
shut up avi
Poted by Kealiock on 12 Mar 2006 07:39 -
herbs = world.getvariable ("concoctions_herbs"
if herbs > 0 then world.send "harvest @concoctions_plant"
end if

that btter? im still getting n error
Poted by Indiana on 12 Mar 2006 07:50 -
Well, looks better, perhaps if you post the error you get I could help you more.
Poted by Kealiock on 12 Mar 2006 08:02 -

Expected statement
Line in error:
END IF
Poted by Indiana on 12 Mar 2006 08:06 -
Weird, try to put on different lines the If part, the one after Then and the last one with End If ... other than that don't see any problems, here's an example of a trigger that ... well, works:

If World.GetVariable ("xstd" = 1 Then
World.Send "stand"
End If
Poted by Kealiock on 12 Mar 2006 08:10 -
ill have to post my whole system...
Poted by Kealiock on 12 Mar 2006 08:21 -
A:harv * *
A:world.setvariable "concoctions_herbs","%1"
world.setvariable "concoctions_plant","%2"
world.send "harvest %2"

T:*You reach down and carefully harvest an*
T:herbs = world.getvariable ("concoctions_herbs"
herbs2 = cLng(herbs) - cLng (1)
world.setvariable "concoctions_herbs", herbs2

T:*You have recovered balance on all limbs.*
T:herbs = world.getvariable ("concoctions_herbs"
IF herbs > 0 THEN
world.send "harvest @concoctions_plant"
END IF


ok... thats what i have, but my count is off... so i get an endless loop, or only harvest one
Poted by Indiana on 12 Mar 2006 09:16 -
You can try instead of cLng to use cInt .. still it shouldn't be different from that, the best way to debug this is to watch the Variables list manually and see to what they change .. the script looks fine, but until you see it working .. might not be this way.
Poted by Broly on 12 Mar 2006 13:01 -
Or you can try the plugin you'll find here:

http://bubble.ro/mushscripts

A:harv * *
A:world.setvariable "concoctions_herbs","%1"
world.setvariable "concoctions_plant","%2"
world.send "harvest %2"

T:*You reach down and carefully harvest an*
T:herbs = world.getvariable ("concoctions_herbs"
herbs2 = cLng(herbs) - cLng (1)
world.setvariable "concoctions_herbs", herbs2

T:*You have recovered balance on all limbs.*
T:herbs = world.getvariable ("concoctions_herbs"
IF herbs > 0 THEN
world.send "harvest @concoctions_plant"
END IF


i removed the first trigger from mine, i just decrement it when i send the harvest message...after all, there's no reason for it to fail. You should try doing that.

You don't have to convert the variables and you don't need a second variable, at least in my script it gave no errors if i just used:

herbs = herbs - 1

Then:

world.setvariable "concoctions_herbs", herbs

Anyway, in my opinion, this trigger is to blame:*You reach down and carefully harvest an*(For example, it doesn't match "You reach down and carefully harvest a valerian leaf." because you put "an" instead of "a". The rest looks ok.
Poted by Kealiock on 12 Mar 2006 19:18 -
while testing it i have found that it doesn't send the harvest command after i recouver balance, yet it catchs the line...
Poted by Indiana on 13 Mar 2006 06:10 -
Try
IF cInt(herbs) > 0 THEN
Poted by Kealiock on 13 Mar 2006 21:37 -
well that worked, but now it doesn't want to do the

herbs2 = cInt(herbs) - cInt(1)
world.setvariable "concoctions_herbs",herbs2


and i was wondering broly, if you could show me a sample of the refill alias
Poted by Broly on 14 Mar 2006 16:02 -
You get an error message or the result isn't what you expected?

As for my refill alias, is this what you are looking for?

A: brewlevitation *
Send: brewlevitation(%1)
Send To: Script

'function:brewlevitation

Sub brewlevitation(no)

World.Send "drop pot"

For i=1 to no

   World.Send "outc kelp"
   World.Send "outc kelp"
   World.Send "outc pear"
   World.Send "outc feather"
   World.Send "inpot kelp to pot"
   World.Send "inpot kelp to pot"
   World.Send "inpot pear to pot"
   World.Send "inpot feather to pot"
   
 Next

 World.Send "boil pot for levitation"
 
End Sub



The function should be in your script file, of course.
Poted by Kealiock on 14 Mar 2006 20:06 -
i get an endless loop... my
herbs2 = herbs - 1
trigger doesn't seem to fire right
Poted by Avian on 15 Mar 2006 19:00 -
Can't you just

herbs = herbs - 1

?
Poted by Kealiock on 16 Mar 2006 20:26 -
after scripting in more then one laguage i have come to the habbit of using a differnt variable for evverything, for a safty net

ill post the auto_harvester's fineshed set so you guys can see what mine turned into
Poted by Kealiock on 19 Mar 2006 07:36 -
well, i feel real generous here ya go...

http://www.yourfilelink.com/get.php?fid=52406

ok, that is the world details (triggers,aliases,variable)

http://www.yourfilelink.com/get.php?fid=52407

and the script file

well there is my system, have fun if you wanna try it out

Back to main forum archive

View normal forum version