Kealiock Family Friend
Joined: 11.09.2005 Posts: 210 | Posted: 12 Mar 2006 08:21 Subject: 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 |
Up | View profile :: Send message |
|
Indiana Council Member
Joined: 06.12.2004 Posts: 867 | Posted: 12 Mar 2006 09:16 Subject: 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. |
Up | View profile :: Send message |
|
Broly Family Member
Joined: 12.12.2004 Posts: 61 | Posted: 12 Mar 2006 13:01 Subject: 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. |
Up | View profile :: Send message |
|
Kealiock Family Friend
Joined: 11.09.2005 Posts: 210 | Posted: 12 Mar 2006 19:18 Subject: while testing it i have found that it doesn't send the harvest command after i recouver balance, yet it catchs the line... |
Up | View profile :: Send message |
|
Indiana Council Member
Joined: 06.12.2004 Posts: 867 | Posted: 13 Mar 2006 06:10 Subject: Try IF cInt(herbs) > 0 THEN |
Up | View profile :: Send message |
|
Kealiock Family Friend
Joined: 11.09.2005 Posts: 210 | Posted: 13 Mar 2006 21:37 Subject: 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 |
Up | View profile :: Send message |
|
Broly Family Member
Joined: 12.12.2004 Posts: 61 | Posted: 14 Mar 2006 16:02 Subject: 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. |
Up | View profile :: Send message |
|
Kealiock Family Friend
Joined: 11.09.2005 Posts: 210 | Posted: 14 Mar 2006 20:06 Subject: i get an endless loop... myherbs2 = herbs - 1 trigger doesn't seem to fire right |
Up | View profile :: Send message |
|
Avian Council Member
Joined: 12.12.2004 Posts: 1124 | Posted: 15 Mar 2006 19:00 Subject: Can't you just
herbs = herbs - 1
? |
Up | View profile :: Send message |
|
Kealiock Family Friend
Joined: 11.09.2005 Posts: 210 | Posted: 16 Mar 2006 20:26 Subject: 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
|
Up | View profile :: Send message |
|
|