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
Einder
Novice


Joined: 03 Jan 2008
Posts: 48

PostPosted: Tue Aug 05, 2014 10:10 am   

Help with Kill Script
 
I've been working on creating an alias that executes a series of commands. Unfortunately when I try to set the trigger to get the mob name for remove a spell affection, I end up with the last mob in the room instead of the one I'm attacking, or I end up with the first command sent to the mud. Can this be fixed?

Code:
#CLASS {kill}
#ALIAS kill {
  victim=%1
  #t+ kill-1
  ko @victim
  fighting=1
  }
#ALIAS kill3 {
  #t- kill-1
  #t- kill-2
  #t+ kill-3
  backstab @victim
  }
#ALIAS kill4 {
  #t- kill-1
  #t- kill-2
  #t- kill-3
  }
#ALIAS kill2 {
  #if (%pos( @victim, @sancmob) > 0) {
    #t- kill-1
    #t+ kill-2
    remsanc @victim
    } {
    #t- kill-1
    #t- kill-2
    #t+ kill-3
    backstab @victim
    }
  }
#ALIAS throwsoul {
  get soul @potions
  swap soul @held
  throw soul @victim
  grab @held
  }
#VAR fighting {0}
#VAR sancmob {kaveto is resting here. (blue aura)}
#VAR victim {Rudi}
#TRIGGER {^{He|She|It} glows with a bright light!$} {
  sancmob = %null
  sancmob = %lower( %line2)
  } "" {disable}
#TRIGGER {^{He|She|It} is surrounded by a black halo!$} {
  sancmob = %null
  sancmob = %lower( %line2)
  } "" {disable}
#TRIGGER {You (&%w) (*) with a soul potion.} {#IF ({%1})=({missed}) {throwsoul}}
#CLASS 0
#CLASS {kill|kill-3}
#TRIGGER {makes a strange sound but is suddenly very silent as you place} {kill4}
#TRIGGER {makes a strange sound as you place} {kill4}
#TRIGGER {you don't know {his|her|its} anatomy well enough} {
  kil @victim
  kill4
  }
#CLASS 0
#CLASS {kill|kill-1}
#TRIGGER {already out cold.} {kill3}
#TRIGGER {You manage to hit {him|her|it}, but not quite where you wanted.} {
  kill4
  fighting=1
  }
#TRIGGER {like you don't know where to hit} {kill3}
#TRIGGER {you can't find a weak spot} {kill3}
#TRIGGER {Looks like you didn't even manage to hit {him|her|it}.} {ko @victim}
#TRIGGER {is out cold.} {kill3}
#CLASS 0
#CLASS {kill|kill-2}
#TRIGGER {stops glowing.$} {kill3}
#TRIGGER {~| %d %d %d ~|} {#if (%pos( "Ok.", %line3) > 0) {remsanc @victim}}
#CLASS 0


The Mud output is as follows:
Code:
Kaveto is resting here. (Blue Aura)
He glows with a bright light!
A wise priest is standing here. (Blue Aura)
He glows with a bright light!
His eyes shine in a soft blue!


Last edited by Einder on Wed Aug 06, 2014 10:32 am; edited 1 time in total
Reply with quote
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: Wed Aug 06, 2014 4:02 am   
 
Oh boy, several years later and you're still hung up on that simplistic bot script from Finished Scripts, so cute :)

Have a look at the discussion I and Arminas had a while, while, while back. If I recall correctly, it had plentiful of useful ideas before we turned to PM and started to build the bot for earnest (oh the memories from ~2010 or so) Twisted Evil

Bottom line: you won't get any help here anyways, botting is forboten Rolling Eyes
_________________
The Proud new owner of CMud.

--------------------------------
Intel Core i5-650 3,2GHz
4 DD3 RAM
GTX 460 768MB
Win 7 Home Premium 64x
--------------------------------
Reply with quote
Einder
Novice


Joined: 03 Jan 2008
Posts: 48

PostPosted: Wed Aug 06, 2014 4:24 am   
 
This is not a bot script. It's a simple edit of my kill command.

As well I know bots are illegal in most all mud's. Though I do know that the definition of a bot varies from mud to mud.

All this script is meant to actually accomplish is going from a simple kill command (hit mob) to a more complex one (knockout mob, debuff, then backstab). I'm fine with it if no one has any ideas on how to help or wants to, but I don't want it assumed that because kill is in the subject that it's automagically a bot either.

EDIT: changed post based on the fact that after thinking it through, my wording sounded more like I was trying to fight which I wasn't.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Aug 07, 2014 12:17 am   
 
You will likely want to investigate multistate triggers, they can handle a lot of the old stuff that longtime zmud users got comfortable using/working around. One large example is the frequent use of #T+ and #T- to manage trigger order (the old way would be subject to lag issues).
_________________
EDIT: I didn't like my old signature
Reply with quote
Einder
Novice


Joined: 03 Jan 2008
Posts: 48

PostPosted: Fri Aug 08, 2014 6:11 am   
 
How does a multistate trigger work in an alias like this? or in general for that matter. The help file is confusing on the subject
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