jrsjr Newbie
Joined: 27 Aug 2006 Posts: 1
|
Posted: Sun Aug 27, 2006 2:30 pm
auto wander/harvest/sale script |
Hello! I am trying to make a script that auto collects. It trys random directions until it moves that direction, if there is a certain item on the floor, it picks it up, and then moves again.
Ive got this part working, after having modified someone elses basic combat script. The things Im trying to add and dont know how is: Moving in the direction I didnt enter the room from, and to only try directions that are valid exits. (IE not run into walls.) Also, I would like it to detect when I have too many to carry, and to go to the trader, (Which involves an "enter turbocar" and "leave" command and a little wait on each.) sell them, and come back and start collecting again.
Thank you!
Code: |
#CLASS {spicebot} {enable}
#ALIAS ud1 {
%item( @dirList, %random( 1, 8))
#va move ud1
}
#ALIAS autok {
#class spicebot
#VAR dirList {n|e|s|w|ne|nw|se|sw}
#alias n {north}
#alias s {south}
#alias e {east}
#alias w {west}
#alias ne {northeast}
#alias nw {northwest}
#alias se {southeast}
#alias sw {southwest}
}
#ALIAS gospice {
#echopr %ansi( yellow)
#echopr %ansi( yellow) --------------------
#echopr %ansi( yellow) Spice Bot Started!!!
#echopr %ansi( yellow) --------------------
#echopr %ansi( yellow)
#class spicebot
autok
#var move ud1
#trigger {Obvious exits:} {
#WA 500
%item( @dirList, %random( 1, 8))
}
}
#ALIAS stopspice {
#echopr %ansi( yellow) Spice Bot Halted!!!
#alias n {north}
#alias s {south}
#alias e {east}
#alias w {west}
#alias ne {northeast}
#alias nw {northwest}
#alias se {southeast}
#alias sw {southwest}
#trigger {Obvious exits:} {
#WA 500
%item( @dirList, %random( 1, 8))
}
}
#ALIAS resume {@move}
#ALIAS n {north}
#ALIAS s {south}
#ALIAS e {east}
#ALIAS w {west}
#ALIAS ne {northeast}
#ALIAS nw {northwest}
#ALIAS se {southeast}
#ALIAS sw {southwest}
#VAR dirList {n|e|s|w|ne|nw|se|sw}
#VAR move {ud1}
#TRIGGER {Some low grade glitterstim spice lays here} {get glit}
#TRIGGER { a pile of} {get all.coin}
#TRIGGER {Obvious exits:} {
#WA 500
%item( @dirList, %random( 1, 8))
}
#TRIGGER {Alas, you cannot go that way.} {
%item( @dirList, %random( 1, 8))
#va move ud1
}
#CLASS 0 |
|
|