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
Eul
Wanderer


Joined: 30 Jun 2007
Posts: 53

PostPosted: Sat Apr 26, 2008 2:11 pm   

Spot the problem
 
Because I cannot! I have had a look at this a few times, and I cannot see the problem. It keeps sending a } to the mud I am playing when it encounters an npc I want to engage. It will paste the echo, then the "}", then start combat.
Please, someone point it out! :)

Code:

#CLASS {akill}
#TRIGGER {({@NPCLIST}) * here} {
  #echo NPC's to kill!
  #if (%line=~"{@PLAYERLIST}*here." ) {
    #SUSPEND a1
    #SUSPEND killpause
    #SUSPEND launchpause
    #t- walk
    #t- akill
    #t+ walk
    #t+ akill
    #step
    #pause
    } {
    #if (%line=~"{@killfirst}*here" ) {
      #T- walk
      #T- akill
      #SUSPEND a1
      #alarm "killpause" +2 {
        k %1
        #alarm "launchpause" +3 {sl %1}
        }
      } {
      #T- walk
      #T- akill
      #alarm "killpause" +2 {k %1}
      #alarm "launchpause" +3 {sl %1}
      }
    }
  #CLASS 0
  }
#CLASS 0
Reply with quote
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: Sat Apr 26, 2008 2:28 pm   
 
I may be completely off because I'm not using structure like that myself, but.

Can you use patterns really the way you do in your %line parts?

That caught my eye first off but as I said it could very well be OK and I'm off here.

Don't have time at the moment to test if this works too or not.

I'm sure someone else will know for sure or point you to right track if needed.


Prog
_________________
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
Eul
Wanderer


Joined: 30 Jun 2007
Posts: 53

PostPosted: Sat Apr 26, 2008 2:31 pm   
 
As far as I know, yes. The trigger works, just just keeps sending a } to the mud, but I am having trouble finding where it is.

Thanks,
Reply with quote
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: Sat Apr 26, 2008 2:38 pm   
 
Indeed it spams the }.

It seemed to me that you had the second if nested as a part of first one. I don't know if its intended, but maybe the following works.

Code:

#echo NPC's to kill!
 #if (%line=~"{@PLAYERLIST}*here." ) {
  #SUSPEND a1
  #SUSPEND killpause
  #SUSPEND launchpause
  #t- walk
  #t- akill
  #t+ walk
  #t+ akill
  #step
  #pause
  }
 #if (%line=~"{@killfirst}*here" ) {
  #T- walk
  #T- akill
  #SUSPEND a1
  #alarm "killpause" +2 {
    k %1
    #alarm "launchpause" +3 {sl %1}
    }
  } {
  #T- walk
  #T- akill
  #alarm "killpause" +2 {k %1}
  #alarm "launchpause" +3 {sl %1}
  }


You should understand, what I changed.

Get back to me with results!

Prog
_________________
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
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Sat Apr 26, 2008 2:43 pm   
 
Code:
#CLASS {akill}
#TRIGGER {({@NPCLIST}) * here} {
#echo NPC's to kill!
#if (%line=~"{@PLAYERLIST}*here." ) {
    #SUSPEND a1
    #SUSPEND killpause
    #SUSPEND launchpause
    #t- walk
    #t- akill
    #t+ walk
    #t+ akill
    #step
    #pause
} {#if (%line=~"{@killfirst}*here" ) {
      #T- walk
      #T- akill
      #SUSPEND a1
      #alarm "killpause" +2 {
        k %1
        #alarm "launchpause" +3 {sl %1}
        }
      } {
      #T- walk
      #T- akill
      #alarm "killpause" +2 {k %1}
      #alarm "launchpause" +3 {sl %1}
      }
    }}
#CLASS 0


Removed 1st #CLASS 0
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sat Apr 26, 2008 3:24 pm   
 
More cleanups and adjustments
Code:
#CLASS {akill}
#TRIGGER {({@NPCLIST}) * here} {
 #echo NPC's to kill!
 #if (%ismember("%1",@PLAYERLIST)) {
  #SUSPEND a1
  #SUSPEND killpause
  #SUSPEND launchpause
  #t+ walk
  #t+ akill
  #step
  #pause
 } {
  #if (%ismember("%1",@killfirst)) {
   #SUSPEND a1
   #alarm "launchpause" +5 {sl %1}
  } {
   #alarm "launchpause" +3 {sl %1}
  }
  #T- walk
  #T- akill
  #ALARM "killpause" +2 {k %1}
 }
}
#CLASS 0
Adjusted indentation to my style so I would be comfortable playing with it.
Changed redundant use matching operator in the #IF's to %ismember
Reduced duplication of code by moving the same portions out to higher level.
Removed #T-'s from the @PLAYERLIST branch as they were followed by matching #T+'s
_________________
The only good questions are the ones we have never answered before.
Search the Forums

Last edited by Vijilante on Sat Apr 26, 2008 3:25 pm; edited 1 time in total
Reply with quote
Eul
Wanderer


Joined: 30 Jun 2007
Posts: 53

PostPosted: Sat Apr 26, 2008 3:25 pm   
 
Progonoi wrote:
Indeed it spams the }.

You should understand, what I changed.

Get back to me with results!

Prog


Yeah, you took out the extra class, end removed a } after my first #if statment. I think. and it works now :)

Thanks!
Reply with quote
Eul
Wanderer


Joined: 30 Jun 2007
Posts: 53

PostPosted: Sat Apr 26, 2008 3:37 pm   
 
Vijilante wrote:
More cleanups and adjustmentsAdjusted indentation to my style so I would be comfortable playing with it.
Changed redundant use matching operator in the #IF's to %ismember
Reduced duplication of code by moving the same portions out to higher level.
Removed #T-'s from the @PLAYERLIST branch as they were followed by matching #T+'s


Kewl, but I think you killed it. I'll test later but I dont reconise how the ismember @fisrtkill attacks before using special attacks. Ather than that it looks alot neater, I'll have a play :)

Thanks,
Reply with quote
Eul
Wanderer


Joined: 30 Jun 2007
Posts: 53

PostPosted: Mon Apr 28, 2008 7:53 am   
 
Just another question!

The mud I play gives a constant health and mana feedback to zmud. Is there a way to make an #if statment to check those values?

EDIT - just making myself clearer, the information is not an output from the mud, it is appearing on the bottom of the zmud window.

Thanks!
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Mon Apr 28, 2008 10:42 am   
 
%mud.hp is one way to referance them
_________________
Discord: Shalimarwildcat
Reply with quote
Eul
Wanderer


Joined: 30 Jun 2007
Posts: 53

PostPosted: Mon Apr 28, 2008 3:21 pm   
 
Thank you!

if a take a look at the help file for that will it also point to other commands for them?

I would check, but posting quickly from work :)

E.
Reply with quote
Eul
Wanderer


Joined: 30 Jun 2007
Posts: 53

PostPosted: Mon Apr 28, 2008 6:21 pm   
 
Well I couldent find much documentation, but after getting back to my home computer it really is quite simple.

Thanks again for all the help.
Reply with quote
Eul
Wanderer


Joined: 30 Jun 2007
Posts: 53

PostPosted: Tue Apr 29, 2008 5:21 pm   
 
Is there a command to stop a trigger being fired more than say one every minuet?

Thanks,
Reply with quote
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: Tue Apr 29, 2008 5:41 pm   
 
You can turn triggers on/off with #t -/+.

Alarms you can set certain times and they're disabled until the time is called.

Other than that hrm I'm not sure I understand what you mean.

Prog
_________________
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
Eul
Wanderer


Joined: 30 Jun 2007
Posts: 53

PostPosted: Tue Apr 29, 2008 6:04 pm   
 
Ah, just thought of a way.

Code:
#class{greetProgonoi}
          #trig {Progonoi is standing here.} {say hello!;t#- greetProgonoi;#alarm "greetcooldown" +60 {#t+ greetProgonoi}}
           #class 0

Or something like that, unless there is a command for it? :)

E.
Reply with quote
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: Tue Apr 29, 2008 8:31 pm   
 
Code:


#class {greetProgonoi}
#trig {Progonoi is standing here.} {say hello!;#t- greetProgonoi;#alarm "greetcooldown" +60 {#t+ greetProgonoi}}
#class 0



Fixed some mistakes. Unless you typoed you didn't have a space between #class and its name and you had t#- instead of #t-.

Idea is nice though. Ultimately you could just make a dynamic *trigger* with a fixed name.

Code:


#class {greetstuff}
#trigger "GreetTrig" {(%w) is standing here.$} {#say hello, %1!;#t- GreetTrig;#alarm "greetcooldown" +60 {#t+ GreetTrig}}
#class {0}



Just an idea because dynamical stuff like that would open the way to make a list of people you'd like to greet etc in the future...

That and I'm not very keen on disabling/enabling classes myself, heh.

Prog
_________________
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
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