PDA

View Full Version : Having a problem



Lackenberge
06-12-2004, 04:23 AM
Ok been debugging/running this script that I've been working on and it fails (more often than not) to pick up a gem when it does a loot. I have had a few successes where the script will actually pick up a gem and put it in my container, but I've seen it skip over way too many other ones. I'm hoping for any advice.

Thanks in advance~

Here is my script, try not to ridicule me too badly, I am still learning.

movement1:

match room1 provide a small resting place
match room2 circle of rocks encases charred
match room3 where they disappear into its depths
match room4 lie discarded in one corner
match room5 splashed by the bucketful
match room6 underbellies casts unsettling
match room7 radiates an unearthly glow
match room8 pear-shaped objects are all
match room9 underneath this silent deathtrap
match room10 difficult as the ground suddenly
match room11 chunky blue and green fuzzy
match room12 inch cautiously along the edges
match room13 are so old that they are
match room14 arranged by the creators of
match room15 flapping of many wings and
match room16 water plummets from a considerably
match room17 jagged pieces from their tops
match room18 remains of a gigantic insect are
match room19 row of oblong niches are cut
match room20 carry the ore the miners freed
put look
matchwait


room1:
save NextRoom1
goto start

room2:
save NextRoom2
goto start

room3:
save NextRoom3
goto start

room4:
save NextRoom4
goto start

room5:
save Nextroom5
goto start

room6:
save Nextroom6
goto start

room7:
save Nextroom7
goto start

room8:
save Nextroom8
goto start

room9:
save Nextroom9
goto start

room10:
save Nextroom10
goto start

room11:
save Nextroom11
goto start

room12:
save Nextroom12
goto start

room13:
save Nextroom13
goto start

room14:
save Nextroom14
goto start

room15:
save Nextroom15
goto start

room16:
save Nextroom16
goto start

room17:
save Nextroom17
goto start

room18:
save Nextroom18
goto start

room19:
save Nextroom19
goto start

room20:
save Nextroom20
goto start


Nextroom1:
put go crev
save nextroom2
goto start

Nextroom2:
put e
save nextroom3
goto start

Nextroom3:
put nw
save nextroom4
goto start

Nextroom4:
put n
save nextroom5
goto start

Nextroom5:
put n
save Nextroom6
goto start

Nextroom6:
put n
save Nextroom7
goto start

Nextroom7:
put n
save Nextroom8
goto start

Nextroom8:
put nw
save nextroom9
goto start

Nextroom9:
put w
save nextroom10
goto start

Nextroom10:
put n
save nextroom11
goto start

Nextroom11:
put w
save nextroom12
goto start

Nextroom12:
put d
save nextroom13
goto start

Nextroom13:
put d
save nextroom14
goto start

Nextroom14:
put d
save nextroom15
goto start

Nextroom15:
put nw
save nextroom16
goto start

Nextroom16:
put nw
save nextroom17
goto start

Nextroom17:
put ne
save nextroom18
goto start

Nextroom18:
put ne
save nextroom19
goto start

Nextroom19:
put nw
save nextroom20
goto start

Nextroom20:
put se
move sw
move sw
move se
move se
move up
move up
move up
move e
move s
move e
move se
move s
move s
move s
move s
move se
move w
put out
save Nextroom1
goto start

START:

match %s% disk
match %s% also here
match start2 obvious exits
match start2 obvious paths
matchwait

pause 1

Start2:

match kill a kiramon worker
match kill a kiramon defender
match %s% Obvious exits:
match %s% Obvious paths:
put look
matchwait


kill:
put kill
match movement1 you referring to
match dead and dies
match dead But it is dead!
match kill roundtime
matchwait

goto start2

dead:
pause 1
put look
goto checktreasure

checktreasure:
match pap pap
match parch parch
match orb orb
match zircon zircon
match topaz topaz
match wand wand
match ring gold ring
match coral coral
match shell shell
match garnet garnet
match emerald emerald
match spinel spinel
match sap sapphire
match lap lapis
match pearl pearl
match ruby ruby
match statue statue
match ame amethyst
match vel vel
match flask flask
match gem gem
match amber amber
match amulet amulet
match crystal crystal
match tou tourmaline
match opal opal
match diamond diamond
match scroll scroll
match glimaer glimaer
match turq turq
match than than
match sunsto sunsto
match obsidi obsidi
match modwir modwir
match hyac hyac
match jacin jacin
match haon haon
match carbun carbun
match chalced chalced
match blazest blazest
match agate agate
match moonstone moonstone
match start2 Could not find a valid target to loot.
put loot
wait
put look
match start2 obvious exits
match start2 obvious paths
matchwait

sap:
setvariable treasure sapphire
goto treasure

vel:
setvariable treasure vel
goto treasure

pap:
setvariable treasure pap
goto treasure

parch:
setvariable treasure parch
goto treasure

orb:
setvariable treasure orb
goto treasure

scroll:
setvariable treasure scroll
goto treasure

statue:
setvariable treasure statue
goto treasure

amulet:
setvariable treasure amulet
goto treasure

crystal:
setvariable treasure crystal
goto treasure

amber:
setvariable treasure amber
goto treasure

gem:
setvariable treasure gem
goto treasure

flask:
setvariable treasure flask
goto treasure

moonstone:
setvariable treasure moonstone
goto treasure

emerald:
setvariable treasure emerald
goto treasure

spinel:
setvariable treasure spinel
goto treasure

coral:
setvariable treasure coral
goto treasure

ring:
setvariable treasure ring
goto treasure

mother:
setvariable treasure mother
goto treasure

zircon:
setvariable treasure zircon
goto treasure

wand:
setvariable treasure wand
goto treasure

shell:
setvariable treasure shell
goto treasure

pearl:
setvariable treasure pearl
goto treasure

garnet:
setvariable treasure garnet
goto treasure

topaz:
setvariable treasure topaz
goto treasure

stone:
setvariable treasure stone
goto treasure

topaz:
setvariable treasure topaz
goto treasure

lap:
setvariable treasure lapis
goto treasure

ruby:
setvariable treasure ruby
goto treasure

quartz:
setvariable treasure quartz
goto treasure

ame:
setvariable treasure amethyst
goto treasure

tou:
setvariable treasure tourmaline
goto treasure

opal:
setvariable treasure opal
goto treasure

diamond:
setvariable treasure diamond
goto treasure

turq:
setvariable treasure turq
goto treasure

glimaer:
setvariable treasure glimaer
goto treasure

than:
setvariable treasure than
goto treasure

sunsto:
setvariable treasure sunsto
goto treasure

stone:
setvariable treasure stone
goto treasure

obsidi:
setvariable treasure obsidi
goto treasure

modwir:
setvariable treasure modwir
goto treasure

hyac:
setvariable treasure hyac
goto treasure

jacin:
setvariable treasure jacin
goto treasure

haon:
setvariable treasure haon
goto treasure

carbun:
setvariable treasure carbun
goto treasure

chalced:
setvariable treasure chalced
goto treasure

blazest:
setvariable treasure blazest
goto treasure

agate:
setvariable treasure agate
goto treasure

treasure:
put get %treasure%
wait
put open my sack
wait
put put my %treasure% in my sack
wait
put close my sack
wait
goto start2

Chadj
06-12-2004, 04:24 AM
I've never written one in that style (FE?) before. I will help you in the morning. Too tired now.

SHIVERPLUSPLUS
06-12-2004, 10:13 AM
looks like you're doing a look, then matching treasure, then loot. Don't you have to loot, then match treasure? Replace the 'put look' under the dead: tag to 'put loot', should fix it? YMMV.

TheEschaton
06-12-2004, 11:08 AM
Yeah, you have the matchwait after the look, it's gonna expect the matching to be done on the look, as opposed to the loot. You just have to separate it into two bodies. I'm actually kinda confused....I think there might need to be a match for finding nothing at all? I don't remember if it just falls out of the match, if nothing matches. Maybe it does. Try this at the end of "checktreasure":

...
match agate agate
match moonstone moonstone
match start2 Could not find a valid target to loot.
put loot
matchwait

checktreasure2:
pause 1
put look
match start2 obvious exits
match start2 obvious paths
matchwait

That way, if it doesn't find any treasure, it'll go to checktreasure2.

Now, the thing which is beyond me is the fact that in checktreasure2, you're simply ALWAYS gonna go to start2 (since those one of those two strings is always gonna show up in a LOOK). What this means is that either you can: A) in "checktreasure", match for a no treasure message, and match it to start2, or (and this might be the case), B) if there is no universal message for not having any treasure, just make checktreasure2 into a goto command, IE:

...
match agate agate
match moonstone moonstone
match start2 Could not find a valid target to loot.
put loot
matchwait

checktreasure2:
goto start2

SHIVERPLUSPLUS
06-12-2004, 11:32 AM
Doesn't the loot verb cause something like: 'You find an agate' or whatever? If that's the case, you can just use loot and skip the look part and make things simplah. I dunno 'cuz I'm still hunting stuff without loot and I don't have loot scoopage scripted yet. :smilegrin:

edit: doh yeah if there's multiple lootables, you'll need a look loop I guess...

[Edited on 6-12-2004 by SHIVERPLUSPLUS]

TheEschaton
06-12-2004, 11:52 AM
His script goes into the loot loop only when he tries to cast at something dead. Thus, it would only need to loot once.


-TheE-

SHIVERPLUSPLUS
06-13-2004, 08:25 AM
Yeah yeah, one loot but you need mutiple looks for each lootable item match no? I'm almost done with urgh's so I'll find out.. :socool: