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


Joined: 31 Jan 2003
Posts: 49
Location: Australia

PostPosted: Fri Feb 21, 2003 6:21 pm   

Using #Sub in a rl time list
 
Ok first I will show you what it is I am doing. I have a list that looks like this

00 XXXXXXXXXXXXXXXXX
01 XXXXXXXXXXXXXXXXXXXX
02 XXXXXXXXXXXXXXXXXXXXXXX
03 XXXXXXXXXXXXXXXXXXXXXXXXXX
04 XXXXXXXXXXX
05 XXXXXXXXXXXXXXX
06 XXXXXXXXXXXXXXXXXXXX
This continues to 23, basically this is the muds Page busy page. Each X represents logins.
The problem I have is that the times i.e. 00 is set at the servers time. Living 15 hours different from this I decided I would #sub them like this:
#tr {00 XXXX} {#sub {15 XXXX}}

The problem is that of course I am eventually going to hit the point where a #sub subs a #sub.
Any ideas how I fix this?

I know that sounds wierd but its not.

Any help appreciated
Amylon

--------------------
#trigger {(*) tells you, '} {tell %1 NO}
--------------------
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Fri Feb 21, 2003 6:58 pm   
 
Easily done with a looping pattern.

What is this list have before it lists? What does it have after it lists?


Similar Concept:
#TRIGGER InvTrig {Inventory} {#VAR Inv "";#TEMP {^$} {#STATE InvTrig 0}}
#COND {} {#ADDITEM Inv %line} {LoopLines|Param=99}


Hence the questions I ask about what is before and after.
It would be easy to subtract your time zone from the looping pattern.

Ton Diening
Reply with quote
Amylon
Novice


Joined: 31 Jan 2003
Posts: 49
Location: Australia

PostPosted: Fri Feb 21, 2003 7:13 pm   
 
Before it comes:
------------------------------{B U S Y H O U R S}------------------------------

But after it is nothing?
Perhaps I could use my prompt?
This is my prompt trigger at present:

#TRIGGER {H(*).(%d)~% M(*).(%d)~% E(*).(%d)~% S(*).(%d)~% M(*).(%d)~% LEFT (*) ~$(*)>} {#GAG;#var hp %1;#var x %2;#var mana %3;#var x %4;#var ess %5;#var x %6;#var soul %7;#var x %8;#var move %9;#var x %10;#var left %11;#var gold %12} "" {prompt}

The x variables are because the mud outputs stats as 00.00%, I dont use them so I just set them as x.


--------------------
#trigger {(*) tells you, '} {tell %1 NO}
--------------------
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Feb 21, 2003 7:22 pm   
 
Ton, there will be exactly 24 lines if that helps.

LightBulb
Advanced Member
Reply with quote
Amylon
Novice


Joined: 31 Jan 2003
Posts: 49
Location: Australia

PostPosted: Fri Feb 21, 2003 10:38 pm   
 
Is there a way to not have to use those #var X's and instead catch the variable in its entiorety? e.g. 12.34% Just thought I would ask while I was here?

--------------------
#trigger {(*) tells you, '} {tell %1 NO}
--------------------
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Feb 22, 2003 1:11 am   
 
#TR {-~{B U S Y H O U R S~}-} {}
#COND {^(%d) (%w)} {#ADDK busy %1 %2;#GAG} {LoopPat|Param=23}
#COND {^(%d) (%w)} {#ADDK busy %1 %2;#GAG;#LOOPDB @busy {#SHOW {%eval( (%key + 15) 24) %val}}}

You can match decimal numbers with the %x wildcard. The #VAR command will (apparently) store these as numbers, provided they don't start or end with the decimal point. 0.23 is okay, .23 isn't. 23 is okay, 23.0 is okay, 23. isn't.

LightBulb
Advanced Member
Reply with quote
Emit
Magician


Joined: 24 Feb 2001
Posts: 342
Location: USA

PostPosted: Sat Feb 22, 2003 2:52 am   
 
quote:

Before it comes:
------------------------------{B U S Y H O U R S}------------------------------

But after it is nothing?
Perhaps I could use my prompt?
This is my prompt trigger at present:

#TRIGGER {H(*).(%d)~% M(*).(%d)~% E(*).(%d)~% S(*).(%d)~% M(*).(%d)~% LEFT (*) ~$(*)>} {#GAG;#var hp %1;#var x %2;#var mana %3;#var x %4;#var ess %5;#var x %6;#var soul %7;#var x %8;#var move %9;#var x %10;#var left %11;#var gold %12} "" {prompt}

The x variables are because the mud outputs stats as 00.00%, I dont use them so I just set them as x.


--------------------
#trigger {(*) tells you, '} {tell %1 NO}
--------------------



you don't have to surround the %d's etc. with (). a %d will match a number, if it is inside () it will be saved as one of %1-%99.

#TRIGGER {H(*).%d~% M(*).%d~% E(*).%d~% S(*).%d~% M(*).%d~% LEFT (*) ~$(*)>} {#GAG;#var hp %1;#var mana %2;#var ess %3;#var soul %4;#var move %5;#var left %6;#var gold %7} "" {prompt}

and would work too :)

--------

moon.icebound.net:9000
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Sat Feb 22, 2003 7:54 am   
 
quote:

Ton, there will be exactly 24 lines if that helps.

LightBulb
Advanced Member



*slap head* Of course, didn't see that.

Ton Diening
Reply with quote
Amylon
Novice


Joined: 31 Jan 2003
Posts: 49
Location: Australia

PostPosted: Sat Feb 22, 2003 9:45 am   
 
I might be stoopid or something but I cant get this to work. Should I just paste it in command line or ?
Do I need to create a db or something?

Also anyone got any ideas why this dont work?
#ALIAS xplist {#math xpp {@level~/100};#MATH xxp {@left~/@xpp};#math xpt {100-@xxp}};#echo @xpt
It tells me The value of xpp 200/100 instead of 2.

Amylon the Dumb for a Day
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sat Feb 22, 2003 1:28 pm   
 
Yes, just paste it into the command line and press Enter.

As for the xplist alias that doesn't work, remove the ~'s before the /'s in the #MATH's commands. Whoa, I think that sentence had too many 's's.

Kjata
Reply with quote
Amylon
Novice


Joined: 31 Jan 2003
Posts: 49
Location: Australia

PostPosted: Sat Feb 22, 2003 1:50 pm   
 
With the page busy, it just produces an empty trigger called -{B U S Y H O U R S~}- but when I type page busyit is still all the same.

Ok getting on to the xplist alias I checked values and this is what is happening even with the ~'s removed:

#ALIAS xplist {#math xpp {@level~/100};#MATH xxp {@left~/@xpp};#math xpt {100-@xxp}};#echo @xpt
#ALIAS xplist {#math xpp {22000/100};#MATH xxp {10000/22000/100};#math xpt {100-<empty>}};#echo xpt

@xpp= 22000/100
@xxp= <empty>
@xpt= 0(false)


--------------------
#trigger {(*) tells you, '} {tell %1 NO}
--------------------
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sat Feb 22, 2003 1:57 pm   
 
Are you using 6.53?

Kjata
Reply with quote
Amylon
Novice


Joined: 31 Jan 2003
Posts: 49
Location: Australia

PostPosted: Sat Feb 22, 2003 2:13 pm   
 
Yep, certainly am, could it be something in settings? Expand vars or something?

Also in special chars it says / is class

--------------------
#trigger {(*) tells you, '} {tell %1 NO}
--------------------
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sat Feb 22, 2003 3:06 pm   
 
There is currently a bug where some stuff doesn't expand correctly. That is what's happening with your #MATH command. This is being discussed in a thread in the Beta Forum.

Kjata
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Feb 22, 2003 11:25 pm   
 
quote:
With the page busy, it just produces an empty trigger called -{B U S Y H O U R S~}- but when I type page busyit is still all the same.

If you cut-and-paste all three lines, it should produce a trigger with three states. The first state should indeed be empty, it's just being used to prevent the trigger from firing on other input. The other two states have the commands.

It works with the sample MUD output you provided. If it doesn't work with the actual MUD, check the patterns.

LightBulb
Advanced Member
Oh, the actual name of that trigger SHOULD be -~{B U S Y H O U R S~}- if you used cut-and-paste.
Reply with quote
Amylon
Novice


Joined: 31 Jan 2003
Posts: 49
Location: Australia

PostPosted: Sun Feb 23, 2003 9:17 pm   
 
GOT IT! Its all good and working now.
I had to go into the the 2 states and change them, by pasting them in through the command line I wass getting this.
STATE 1 missing {LoopPat|Param=23}
so looked like this: #ADDK busy %1 %2;#GAG
STATE 2 Was wierder, it looked like this:
#ADDK busy %1 %2;#GAG;#LOOPDB {#SHOW {0 %{val}}}
Well anyways its all good now, just added in the bits that were missing.

One more little fickle thing
Is there a way to project the 0 before 1-9? I dont really need it but it just cleans it up so that all X's stay above each other.
00
01
02
03
etc

--------------------
#trigger {(*) tells you, '} {tell %1 NO}
--------------------
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Feb 23, 2003 10:23 pm   
 
Modify the #SHOW command. It does improve the appearance.
#TR {-~{B U S Y H O U R S~}-} {}
#COND {^(%d) (%w)} {#ADDK busy %1 %2;#GAG} {LoopPat|Param=23}
#COND {^(%d) (%w)} {#ADDK busy %1 %2;#GAG;#LOOPDB @busy {#SHOW {%if( %eval( (%key + 15) 24) < 10, "0")%eval( (%key + 15) 24) %val}}}

LightBulb
Advanced Member
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Feb 23, 2003 10:55 pm   
 
I decided to anticipate the next request while the script was still fresh in my mind. This will start the list at 00 (your time).
#TR {-~{B U S Y H O U R S~}-} {}
#COND {^(%d) (%w)} {#MATH newhour ((%1 + 15) 24);#ADDK busy @newhour %2;#GAG} {LoopPat|Param=23}
#COND {^(%d) (%w)} {#MATH newhour ((%1 + 15) 24);#ADDK busy @newhour %2;#GAG;#LOOP 0,9 {#SHOW {"0"%i %db( @busy, %i)}};#LOOP 10,23 {#SHOW {%i %db( @busy, %i)}}}

LightBulb
Advanced Member
Reply with quote
Amylon
Novice


Joined: 31 Jan 2003
Posts: 49
Location: Australia

PostPosted: Sun Feb 23, 2003 11:18 pm   
 
ROFLMAO
You rock!
Thanks

Amylon
--------------------
#trigger {LightBulb tells you, '} {tell %1 You rock!}
--------------------
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