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
agedmoon
Newbie


Joined: 16 Nov 2003
Posts: 2

PostPosted: Sun Nov 16, 2003 5:33 am   

Is it possible to write a triger for this case?
 
Hi, folk

I receive such a message when playing mud:

©°©¤©¤©´©°©¤©¤©´©°©¤©¤©´
¡ö¡ö¡ö©¦¡ö¡ö¡ö©¦¡ö¡ö¡ö©¦
¡ö©¸¡ö©¦©°©¤¡ö©¦¡ö©¸¡ö©¦
¡ö¡ö¡ö©¦¡ö¡ö¡ö©¼¡ö¡ö¡ö©¦
©°©¤¡ö©¦¡ö©¤©¤©´©°©¤¡ö©¦
¡ö¡ö¡ö©¼¡ö¡ö¡ö©¼¡ö¡ö¡ö©¼

Is it possible to write a trigger to convert this piece of infomation
to its digital value 929? Ideally the trigger should be able to handle
all the numbers and any number of numbers of the same format...

Thank you very much!!!!!!
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Nov 16, 2003 7:18 pm   
 
It probably is possible if you know the formula and format involved.
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Tue Nov 18, 2003 9:50 pm   
 
Code:

©°©¤©¤©´©°©¤©¤©´©°©¤©¤©´
<font color="red">¡ö</font id="red"><font color="red">¡ö</font id="red"><font color="red">¡ö</font id="red">©¦<font color="red">¡ö</font id="red"><font color="red">¡ö</font id="red"><font color="red">¡ö</font id="red">©¦<font color="red">¡ö</font id="red"><font color="red">¡ö</font id="red"><font color="red">¡ö</font id="red">©¦
<font color="red">¡ö</font id="red">©¸<font color="red">¡ö</font id="red">©¦©°©¤<font color="red">¡ö</font id="red">©¦<font color="red">¡ö</font id="red">©¸<font color="red">¡ö</font id="red">©¦
<font color="red">¡ö</font id="red"><font color="red">¡ö</font id="red"><font color="red">¡ö</font id="red">©¦<font color="red">¡ö</font id="red"><font color="red">¡ö</font id="red"><font color="red">¡ö</font id="red">©¼<font color="red">¡ö</font id="red"><font color="red">¡ö</font id="red"><font color="red">¡ö</font id="red">©¦
©°©¤<font color="red">¡ö</font id="red">©¦<font color="red">¡ö</font id="red">©¤©¤©´©°©¤<font color="red">¡ö</font id="red">©¦
<font color="red">¡ö</font id="red"><font color="red">¡ö</font id="red"><font color="red">¡ö</font id="red">©¼<font color="red">¡ö</font id="red"><font color="red">¡ö</font id="red"><font color="red">¡ö</font id="red">©¼<font color="red">¡ö</font id="red"><font color="red">¡ö</font id="red"><font color="red">¡ö</font id="red">©¼
123456789012345678901234


A way would be to:

You'll need to capture each line.
Check out the length of each line and divide by 8 to see how many #s there are.

In this case, dividing by 8 gives you 3, you could copy from 1,8 9,17 18,24 for each line and make a long string for each 'number'

Compare that long string against a list to figure out what number it is.

So the second item in the list you would have a match for:
Code:

©°©¤©¤©´
¡ö¡ö¡ö©¦
©°©¤¡ö©¦
¡ö¡ö¡ö©¼
¡ö©¤©¤©´
¡ö¡ö¡ö©¼


Would be represented as
©°©¤©¤©´¡ö¡ö¡ö©¦©°©¤¡ö©¦¡ö¡ö¡ö©¼¡ö©¤©¤©´¡ö¡ö¡ö©¼
Reply with quote
agedmoon
Newbie


Joined: 16 Nov 2003
Posts: 2

PostPosted: Wed Nov 19, 2003 7:55 pm   
 
Wow, Diening you are great! I will be able to write the trigger for this case now.
But one thing I do not know:
The message is displayed at one time, how can I store it as several lines?

Thank you very much!!
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed Nov 19, 2003 11:43 pm   
 
The first line seems to contain the same sequence for each number. You can trigger off that sequence ©°©¤©¤©´ with a multistate trigger. By counting the width of the first %line you will know exactly how to initialize your variables. Looplines with a param of 5 would be perfect. It would appear that only the first 6 characters of an 8 character ¡ö¡ö¡ö©¦
sequence matter. To acelerate conversion I would suggest 5 record variables (one for each pertainent line) with that 6 character portion set as keys, and a bitwise (ie 23567890 all should have a full bar so the final number would be 1005) list of numbers that have that pattern on that line as values. Then your first data line fills all the possibles and you can eliminate with each subsequent line. Probably by the 3rd line it would know what the number is.

Rough example:
#TR {^©°©¤©¤©´} {Digits=%eval(%len(%line)/8);ConvertedNumbers="";LCount=0;#PRIORITY {#LOOP @Digits {#ADDKEY ConvertedNumbers {%i} {1023}}}}
#COND {} {#ADD LCount 1;#PRIORITY {#LOOP @Digits {#ADDKEY ConvertedNumbers {%i} {%bitand(%db(@ConvertedNumbers,%i),%db(@{Line%i},%copy(%line,%eval(%i*8),6)))}}}} {looplines|param=5}
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