Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
jrsjr
Newbie


Joined: 27 Aug 2006
Posts: 1

PostPosted: 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
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net