PDA

View Full Version : Scripting question



Syberus
02-29-2004, 06:34 PM
For some reason I seem to be having a hard time making my script not attack the target if there's another person in the room... Sometimes I can get it to not attack if i start the script with someone in the room.. and then when i move into a room with a person it attacks anyway (as if it didn't go to the right matchwait when I moved) and other times it pauses forever to attack after it checks that there's no one in the room (The only way I could think of to make it work was have the first set of matches check to see if there was a person, and if not go onto the second set of matches to see what was in the room) Anyone have ideas?

Artha
02-29-2004, 06:36 PM
The way I see used is you have a line that looks in every room for the critter type, which matches to a filter. The filter looks for the line Also here It matches that to the moving loop. The filter also checks for the line Obvious paths and/or Obvious exits, if those are present, it goes to the killing loop.

Latrinsorm
02-29-2004, 06:49 PM
The way Artha describes works flawlessly. The nice thing is you can have it look for a disk too, to keep whining ambushers from sullying your name on the official boards. :D

Syberus
02-29-2004, 07:36 PM
This thing if fucking insane.. Sometiems it works.. sometimes it doesn't.. I have no idea what's wrong with it. Anyone mind takign a look?


start:
put look
match mare shadow mare
match steed shadow steed
matchwait

steed:
match wait Also here
match kills Obvious
matchwait

kills:
put prep 302
put channel steed
match others Cast Roundtime
match deads hear a sound like a weeping child
match fumbles fumble
match deads minuscule blue-white star
matchwait

others:
pause 1
goto kills

deads:
pause 1
put get knife
put kneelhit l
pause 1
put skin steed
put stand
pause 1
put put knife in my sheath
put take tail
pause 1
put put tail in my cloak
put search steed
pause 1
put stow right
goto start

mare:
match wait Also here
match killm Obvious
matchwait

killm:
put prep 302
put channel mare
match otherm Cast Roundtime
match deadm hear a sound like a weeping child
match fumblem fumble
match deadm minuscule blue-white star
matchwait

otherm:
pause 3
goto killm

deadm:
pause 1
put get knife
put kneel
pause 1
put skin mare
put stand
pause 1
put put knife in my sheath
put take hoof
pause 1
put put hoof in my cloak
put search mare
pause 1
put stow right
goto start

fumbles:
pause 3
goto steed

fumblem:
put pause 3
goto mare

wait:
pause 2
goto start

I don't get what the problem is.. sometimes it'll look and there will be stuff in the room and it'll just sit there.. and sometimes it'll attack

Bobmuhthol
02-29-2004, 07:40 PM
I'd say it doesn't work because it sucks.

Syberus
02-29-2004, 07:40 PM
Thanks bob.

Bobmuhthol
02-29-2004, 07:41 PM
Anytime syb.

Syberus
02-29-2004, 07:45 PM
Care to fix it for me then?

Bobmuhthol
02-29-2004, 07:49 PM
Is what you posted the entire script?

Syberus
02-29-2004, 07:58 PM
Yes, all it's supposed to do is look, and if there's a mare or steed in the room it kills and skins it using 302 channeled. That part was easy... I ran into problems when he asked me to have it not attack if there's other people in the room, since I've never tried to have a script do that before.

Artha
02-29-2004, 08:02 PM
I don't know about the moving part (you'll have to do that), but here's how I'd have it.

(it moves, goes to this loop)

LoopNameHere:
match filter steed
match filter mare
match movingloop obvious paths
match movingloop obvious exits

filter:
put look
match movingloop also here
match killmare mare
match killsteed steed

killsteed:
You know what to do here

killmare:
You know what to do here too

Syberus
02-29-2004, 08:07 PM
it doesn't have to move.

Artha
02-29-2004, 08:16 PM
Are you moving it around yourself, or just starting it when there's stuff in the room?

Syberus
02-29-2004, 08:18 PM
start with something in the room... and then move manually when the room empties.

Bobmuhthol
02-29-2004, 08:22 PM
<<filter:
put look
match movingloop also here
match killmare mare
match killsteed steed >>

I don't write hunting scripts and never have, but I'm 99% sure that doesn't work.

When you match, it searches for a match by line, then by the order of the matches. Since the creatures are a line above the Also here: string, it will match to them without regarding whether or not someone is in the room.

Syberus
02-29-2004, 08:22 PM
Exactly bob that's what my original problem was, so I had to try to make it look for people and THEN look for creatures.. which is where it all fell to shit.

Artha
02-29-2004, 08:25 PM
match killsteed/killmare to obvious paths/exits instead.

Latrinsorm
02-29-2004, 08:35 PM
Start:
match End creature
match MoveMore Obvious paths:
matchwait

End:
match MoveMore Also here
match KillStuff Obvious paths
matchwait

Works like a charm.

edit: obviously change the paths to exits if you're inside.

second edit: why the hell does it say edited on March 1st?

[Edited on 3-1-2004 by Latrinsorm]

Syberus
02-29-2004, 08:45 PM
What about this?

start:
put look
match wait also here
match scout Obvious
matchwait

scout:
match kills shadow steed
match killm shadow mare
matchwait


then all the other shit about killing and skinning.


Editted because i always forget the damn matchwaits


[Edited on 3-1-2004 by Syberus]

Latrinsorm
02-29-2004, 08:47 PM
I don't know if that will work.

I know mine will work.

Syberus
02-29-2004, 08:53 PM
What was the difference? Sorry i"m not a super script master.. Could you put yours into my script's language so I know what you mean then?

Latrinsorm
02-29-2004, 09:03 PM
Originally posted by Syberus
What was the difference? Sorry i"m not a super script master.. Could you put yours into my script's language so I know what you mean then? All I know is that they are different, I have no idea what yours will do. That's the deal with programming, the slightest difference can make things work or not. In your case I'd put two matches for each creature you want to kill that save the creature's name, then go to my End label, then instead of Killstuff it goes to %s, and kills stuff.

Syberus
02-29-2004, 09:04 PM
never did understand the whole save thing.. ah well i'll figure something out. Script isn't even for me ::mutters::

Syberus
02-29-2004, 10:21 PM
It works! It works! Ahh... the satisfaction of watching your creation do something automatically so you can be lazy...

Bobmuhthol
02-29-2004, 10:33 PM
I wouldn't call a script that kills something if it's in the room and doesn't find it for you a success.

I hope you at least loop it so you don't have to start it up constantly.

Latrinsorm
02-29-2004, 10:43 PM
Originally posted by Bobmuhthol
I wouldn't call a script that kills something if it's in the room and doesn't find it for you a success.

I hope you at least loop it so you don't have to start it up constantly. Baby steps, Bob. Baby steps. We all had to start somewhere. Even (or should I say especially) you. ;)

Bobmuhthol
02-29-2004, 10:45 PM
My first script was the following:

#script

find gypsy fortuneteller

Syberus
02-29-2004, 10:46 PM
the only thing you have to do is move bob.