Results 1 to 5 of 5

Thread: Extremely basic Hunting Script

  1. Default Extremely basic Hunting Script

    So... I'm not COMPLETELY lame... but I was wondering if I could get someone with some ruby / lich knowledge to help me with this... I wrote a script in SF to do what I need (pending testing... on paper it should work). I'm wondering if someone can tell me how to write a routine in lich that'll sit back and watch, and if another critter walks in, it'll kill the script (hit ESC for me) and go defensive. That's all, to keep me from dying with another swing at a time when I can't really afford it.

    Oh... and any comments / critiques of this would be appreciated... Basically it hides, waits for the RT to clear, then as soon as the giant makes a move, hits for the leg. If it doesn't sever it, it hides, waits, and does it again. If it is severed, then it moves on to chopping off the arm (still waiting and being careful). Once that's done, it's just kill time, ambushin the head (which will change to the chest when the head is done), then lootin when it's dead. Nothing elegant about it.

    Code:
    put loot
    put stance def
    goto Prep
    
    Prep:
    put Sign of smiting
    put sign of striking
    put sign of warding
    put sign of defending
    put sign of swords
    pause
    goto Hunt
    
    Hunt:
    put hide
    pause
    goto Wait
    
    Wait:
    match Ambush giant
    matchwait
    
    Ambush:
    put stance off
    put ambush giant right leg
    pause
    goto Examine
    
    Examine:
    put look at giant
    match LootDone dead
    match Hunt2 severed right leg
    match Hunt2 severed left leg
    match Hunt he has
    matchwait
    
    Hunt2:
    put stance def
    put hide
    pause
    goto Ambush2
    
    Ambush2:
    put stance off
    put ambush giant right arm
    pause
    goto Examine2
    
    Examine2:
    put stance def
    put look at giant
    match LootDone dead
    match Hunt3 severed right arm
    match Hunt2 he has
    matchwait
    
    Hunt3:
    put stance def
    put hide
    wait
    goto Ambush3
    
    Ambush3:
    put stance off
    put ambush giant head
    pause
    goto Examine3
    
    Examine3:
    put look at giant
    match LootDone dead
    match Hunt3 he has
    matchwait
    
    LootDone:
    put stance def
    put loot
    exit

  2. #2
    Join Date
    Mar 2006
    Location
    Rubble of the fifth wall.
    Posts
    17,972

    Default

    Is that your boomstick?
    Quote Originally Posted by Anticor
    If you and Jar Jar Binks had a child it would rule the world.
    Quote Originally Posted by Stanley Burrell
    Wikka wikka my nikka yo yo yo yo: CHECK IT. Tha thang in the thang and bedump bedump da BEBANG knowwhatIsayin?!

  3. Default

    KLAATU... VERATA...

    ...necktie... nectar... nickel...

    {mutters} it's an n-word, definitely an n-word...

    It's definitely an n-word.

  4. Default

    Quote Originally Posted by DansMtnVue View Post
    So... I'm not COMPLETELY lame... but I was wondering if I could get someone with some ruby / lich knowledge to help me with this... I wrote a script in SF to do what I need (pending testing... on paper it should work). I'm wondering if someone can tell me how to write a routine in lich that'll sit back and watch, and if another critter walks in, it'll kill the script (hit ESC for me) and go defensive. That's all, to keep me from dying with another swing at a time when I can't really afford it.
    From Command_Quicklist.txt:

    86) kill_script
    89) stop_script

    I'm not sure what the difference is, perhaps stop_script just pauses the script. Anyway, further down the file it has some instructions:

    stop_script("script1", "script2", "script3", "etc.")

    So you'd do something like:

    #stopscriptwhencreaturewalksin.lic

    begin:
    match "stopscript", "messaging when creature walks in"
    match "stopscript", "messaging when creature2 walks in"
    matchwait

    stopscript:
    stop_script("yourhuntingscriptname")
    goto begin

    Mmm...sushi

  5. #5
    Join Date
    Nov 2004
    Location
    Upstate NY
    Posts
    428

    Default

    Lich will have to be running the hunting script, if you weren't aware of that -- it can't stop SF/Wizard scripts (only ones it's running). Actually simulating the ESC key being hit is a whole lot harder than you might think; telling SF the ESC key has been hit is actually possible, but not without more than Lich provides.

    There're lots of ways of doing this, but what seems easiest offhand is...

    Code:
    entry:
      i = 0
      goto :monitor
    
    escape:
      stop_script "huntingScript"
      wait_until { running?("huntingScript") }
      i = 0
      goto :monitor
    
    decrement:
      i -= 1
      goto :check
    
    increment:
      i += 1
      goto :check
    
    check:
      goto :escape if i > 1
    
    monitor:
      match 'increment', 'A very mean looking ant just skittered in!'
      match 'decrement', 'You have slain the ferocious ant!'
      match 'decrement', 'An ant hastily flees from you!'
      matchwait
    The i variable keeps track of how many active critters are in the room; the script will kill the hunting script if i > 1, and then wait until the hunting script is running again to continue. There are "better" ways of handling it, but this is easy to understand and should work pretty well. Oh, BTW, kill_script and stop_script are identical synonyms -- they both execute the same code.
    Last edited by Shaelun; 07-09-2008 at 07:23 AM.
    I visualize a time when we will be to robots what dogs are to humans, and I'm rooting for the machines. -- Claude Shannon

Similar Threads

  1. Learn how to script with this simple hunting script
    By Tgo01 in forum The Lich Project
    Replies: 69
    Last Post: 08-24-2020, 03:20 PM
  2. Basic duskruin trap wizard script
    By RAR in forum Miscellaneous Scripts
    Replies: 7
    Last Post: 07-26-2015, 10:58 PM
  3. Basic Crafting Script
    By Bluke in forum Miscellaneous Scripts
    Replies: 1
    Last Post: 12-14-2014, 03:17 PM
  4. I need a hunting script
    By Satira in forum General Gemstone
    Replies: 4
    Last Post: 06-28-2006, 09:19 AM
  5. Hunting script
    By The Cat In The Hat in forum Scripting Discussion
    Replies: 6
    Last Post: 09-25-2004, 11:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •