PDA

View Full Version : attempt at scripting Jamus's engine! FAILED



Laccon
08-21-2005, 10:17 AM
ok so i wanted to try and make a simple script with jamus's engine to see if i could do it, and apprently i can't. The script is suppose to take steel lockpicks and break them for me, but it is suppose to only break a certain number of them that i tell it to %1 so when it reaches the number that i put in %1 i want it to stop breaking them. heres the script, oh ya and the beggining of it is opiset the IF_1 goto echo (it goes to starting) same with IF_ and the IF_2 goes to echo instead of starting.


if_ goto echo
if_1 goto echo
if_2 goto starting

starting:
set counter 0
counter:
If_counter=%1 goto done
If_else goto breakpick
breakpick:
put get steel lock from my back
matchbool ok You remove
matchbool nolock Get what?
matchwait

ok:
put pick my %2 with my lock
matchbool broken * SNAP * Crud!
matchbool wait Roundtime:
matchwait

wait:
waitrt
goto ok

broken:
put my lock in my harn
goto addbrokenpick

addbrokenpick:
counter add 1
goto counter

nolock:
echo **no more steel lockpicks in backpack!!**
goto done

done:
echo **ALL DONE**
exit

echo:
echo USEAGE: .breakpicks (# of picks to break) (box in your hand)
exit

Laccon
08-22-2005, 10:50 AM
ok... the main problem now is that it isn't really responding to the matchbools, it keeps repeating this part over and over.

breakpick:
put get steel lock from my back
matchbool ok You remove
matchbool nolock Get what?
matchwait

ok:
put pick my %2 with my lock
matchbool broken * SNAP * Crud!
matchbool wait Roundtime:
matchwait

wait:
waitrt
goto ok


even if theres no lockpicks in the backpack and it says "Get what?" it still goes to ok and tries to pick the box, and if the lockpick snaps, it still tries to pick the box instead of going to broken. Anyone got any ideas? it should be reading the matchbool correctly i think.

Tagu
08-23-2005, 04:47 AM
matchbool ok You remove
matchbool nolock Get what?


I think your problem may be that you don't understand matchbools. Unlink a normal match, which would send the program to the section named ok if it matched You remove, a matchbool instead creates a variable named ok and sets it's value to true if it matched You remove.

The rest of your code would need to do something like

if(%ok%)
do stuff
else
if(%nolock%)
do other stuff

Bobmuhthol
08-23-2005, 05:06 AM
I don't know wtf IF_ means since there's no number, but I'll quickly try to recreate this script.

if_2 goto starting
goto echo

starting:
set counter 0

count:
If(counter = %1%) goto done
goto breakpick

breakpick:
put get steel lock from my back
match ok You remove
match nolock Get what?
matchwait

ok:
put pick my %2 with my lock
match broken * SNAP * Crud!
match wait Roundtime:
matchpause 2
goto done

wait:
waitrt
goto ok

broken:
put my lock in my harn
goto addbrokenpick

addbrokenpick:
set counter math(%counter% + 1)
goto count

nolock:
echo **no more steel lockpicks in backpack!!**
goto done

done:
echo **ALL DONE**
exit

echo:
echo USEAGE: .breakpicks (# of picks to break) (box in your hand)
exit



After starting, I quickly realized Tagu is right. You were using matchbool completely incorrectly. You wanted match.

Bobmuhthol
08-23-2005, 05:16 AM
Actually, I'm just looking over the logic of your script and I have no clue what it's supposed to do. My version of it doesn't seem too much better -- just functional.