Looking for more active discussion? Join our Discord at https://discord.gg/x2s7fY6

ZMUD Snaking Script

Basic community service here.  I wrote it, with some help.  I figured I'd share it.
This is a simple script that detects, kills and collects snakes, tallying their values.  Script is toggled via a button.  Change highlighted text for class-appropriate attack.

[code]
#CLASS {VERMIN}
#ALIAS rats {vermin;#t SNAKING;#reset @snakeshere;#reset @snakesvalue;#reset @deadsnakes}
#VAR hunting {NORMAL}
#TRIGGER {^H:(%d)%sM:(%d)%sE:(%d)~%%sW:(%d)~%%sB:(%d)~%%s~[*~]} {currenthealth=%1;currentmana= %2;currentendurance= %3;currentwillpower= %4;blood= %5;#if (%pos( e, %6)) {equilibrium=1} {equilibrium=0};#if (%pos( b, %6)) {balance=1} {balance=0};#if {(@balance) && (@equilibrium)} {sync=Synchronized} {sync=Desynchronized}} "" {nocr|prompt}
#BUTTON 6 {VERMIN OFF} {#t+ SNAKING;hunting = HUNTING;rats} {VERMIN ON} {#T- SNAKING;hunting = NORMAL;rats} {} {1} {SWORD} {Size} {124} {40} {Pos} {1} {809} {} {} {} {} "" {} {} {}
#CLASS 0
#CLASS {VERMIN|SNAKING}
#TRIGGER {^H~:(%d) M~:(%d) E~:(%d)~% W~:(%d)~% B~:(%d)~% ~[(*)~]$} {#if {(@snakeshere) && (@balance)} {strike snake;balance =0;sync =Desynchronized}} "" {nocr|prompt}
#TRIGGER {^You have slain a pebbly black snake.} {#add deadsnakes 1;#add snakeshere -1;#add snakesslain 1;balance =0;sync =Desynchronized}
#TRIGGER {^You pick up the corpse of a pebbly black snake.} {#add deadsnakes -1;#add snakevalue 30}
#TRIGGER {^--- Entrance to the Medina -----} {#if {(@snakevalue)} {sell snake to timothy;#reset @snakeshere;#reset @snakesvalue;#reset @deadsnakes}}
#STAT {| Status: @hunting Vermin In Room: @snakeshere Dead Vermin: @deadsnakes Vermin Value: @snakevalue |}
#CLASS 0
#CLASS {VERMIN|SNAKING|SNAKE ENTRANCE}
#TRIGGER {^Tongue flicking to taste the air, a pebbly black snake comes into view.} {#add snakeshere 1}
#TRIGGER {^The glint of pebbly scales alerts you to the entrance of a black snake.} {#add snakeshere 1}
#TRIGGER {^With a faint slithering noise, a pebbly black snake enters.} {#add snakeshere 1}
#CLASS 0
#CLASS {VERMIN|SNAKING|SNAKE EXIT}
#TRIGGER {^A pebbly black snake slithers away to search for food elsewhere.} {#add snakeshere -1}
#TRIGGER {^With a faint noise of scales against the ground, a black snake slithers away.} {#add snakeshere -1}
#TRIGGER {^A pebbly black snake slithers off in search of prey.} {#add snakeshere -1}
#CLASS 0
#CLASS {VERMIN|SNAKING|GET SNAKE}
#TRIGGER {^H~:(%d) M~:(%d) E~:(%d)~% W~:(%d)~% B~:(%d)~% ~[(*)~]$} {#if {(@deadsnakes) && (@balance)} {get snake};#if {(@snakesslain)=3 && (@balance)} {#sayp NO MORE SNAKES;snakesslain =0}} "" {nocr|prompt}
#CLASS 0
#CLASS {VERMIN|SNAKING|SNAKE VARIABLES}
#VAR snakeshere {0} {0}
#VAR deadsnakes {0} {0}
#VAR snakevalue {0} {0}
#VAR snakesslain {0} {0}
#CLASS 0
[/code]


This should be a simple copy/paste for any ZMUD users.  HOWEVER.  Please do ensure that I'm not referencing variables that you have already defined.  Be advised this script also creates an easy button to toggle ratting on/off and a status bar to track vermin/value.  This may conflict with existing elements of your interface.  For best results, disable other classes, triggers and interface when using OR reconfigure yours to adapt the elements I introduced.
image

Comments

  • Hi I am a newbie and was trying to get this to work in my zmud, for some reason it wont work.  simple copy and paste did not work for me :(
  • AlexinaAlexina the Haunted Soul
    edited January 2013
    Alrighty. One thing stood out to me (although I guess this script works perfectly fine on its own):

    #TRIGGER {^H~:(%d) M~:(%d) E~:(%d)~% W~:(%d)~% B~:(%d)~% ~[(*)~]$} {#if {(@snakeshere) && (@balance)} {strike snake;balance =0;sync =Desynchronized}} "" {nocr|prompt}
    For some reason, that part made me think of Achaea blademasters. That, and you not having a trigger to actually pick up the corpses (this is done automagically in Achaea, but we have to 'get corpse' around here). Heh, anyway, here's what you could do if you turn on 'config balance_taken on':

    #TRIGGER {^Balance Used: %d.%d seconds} {#VAR balance 0}
    #TRIGGER {^Equilibrium Used: %d.%d seconds} {#VAR equilibrium 0}
    #TRIGGER {^You have recovered balance on all limbs.} {#VAR balance 1;#IF (@equilibrium AND @balance) {strike snake}}
    #TRIGGER {^You have recovered equilibrium.} {#VAR equilibrium 1;#IF (@equilibrium AND @balance) {strike snake}}

    I personally use these triggers for tons of things (mostly autobashing), and it's useful in a lot of situations. It's easier for people that're not very familiar with scripting to understand than the prompt trigger in your script. It sort of confused the heck out of me, but then again I'm pretty bad at this kind of stuff. If it was me, I'd probably do something like:

    #ALIAS {verminon} {#SAY Now hunting vermin! Rawr!;#VAR killvermin 1;#VAR verminhunter on}
    #ALIAS {verminoff} {#SAY Let's not hurt those poor buggers anymore!;##VAR killvermin 0;#VAR verminhunter off}

    Then I could just add checks to my balance triggers:
    #TRIGGER {^Balance Used: %d.%d seconds} {#VAR balance 0}
    #TRIGGER {^Equilibrium Used: %d.%d seconds} {#VAR equilibrium 0}
    #TRIGGER {^You have recovered balance on all limbs.} {#VAR balance 1;#IF (@equilibrium AND @balance) {strike snake}}
    #TRIGGER {^You have recovered equilibrium.} {#VAR equilibrium 1;#IF (@equilibrium AND @balance) {strike snake}}
    #TRIGGER {^You have slain a pebbly black snake.} {#IF (!@balance) {queue bal get corpse;get corpse};#IF (!@equilibrium) {queue eq get corpse;get corpse}}

    #STAT {| Vermin: @verminhunter | Vermin In Room: @snakeshere | Dead Vermin: @deadsnakes | Vermin Value: @snakevalue}

    Would obviously have to use the other triggers in your post for some of the other stuff, just showing some suggestions as to how it can be done as well.

    Aaaanyway. There's different vermin in other cities, so would probably be useful to add those lines as well.

    This was a neat little script, thank you for posting it.

    ^_^
    image
Sign In or Register to comment.