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


Joined: 16 Oct 2003
Posts: 2
Location: USA

PostPosted: Tue Mar 23, 2004 10:26 am   

Inequalities aren't working right
 
here is a portion of a larger set of triggers which is supposed to keep track of where the breaks between the ranks in the fellowship of EXPLORERS. as i go throught the EXPLORERS listing which ranks everyone in descending order, some ranks catch on certain numbers they aren't supposed to be at. for instance Continental Wanderer's beginning is at 89, but when i initially go through the ranking system to let this trigger set, set the rank numbers, it sets it at 100. and aparently its becasue of the inequality where the #IF statment thinks that 89>100...and umm..its not. Interestingly, these incorrect rank levels seem to occur at 10's...100...1500..etc..those kind of numbers, but does not do so for ALL 10's...or 100's for that matter...here is the the portion.


#CLASS {ExplorerRankFind|rank}
#VAR level {Sightseer|Vagabond|Itinerant|Rambler|Nomad|Wayfarer|Voyager|Landstrider|Forestwalker|Searcher of Horizons|Vashnarian Climber|Penetrator of the Depths|Desert Roamer|Hunter of the Lost World|Continental Wanderer|Terran Master|Sapient Explorer|Questor of the Far Reaches|Hadionic Seeker|Achaean Ranger}
#VAR levelRank {999999|999999|999999|999999|999999|999999|999999|999999|999999|999999|999999|999999|999999|999999|100|42|18|10|1|0}
#TRIGGER {^(%d)%s* ({@level})$} {#IF (%item( @levelRank, %ismember( %2, @level)) > "%1") {#VAR levelRank %replaceitem( %1, %ismember( %2, @level), @levelRank)} {}}
#CLASS 0


here's what the mud gives me when i put in EXPLORERS 60


*********************************[ Explorers ]*********************************
Rank Name Title
-------------------------------------------------------------------------------
60 EarthDruid Hyperlith Lighthawk a Terran Master
61 Selene's Lioness, Trel Alighieri a Terran Master
62 Druid Hyano a Terran Master
63 Walkyra of the Rainbow Lepida, Blazing a Terran Master
64 Cap'n Dar Antares Alighieri, The Archa a Terran Master
65 Sir Epich D. de Vermiis a Terran Master
66 Linus a Terran Master
67 Harbinger of Cookies, Tiax Drac'kal, E a Terran Master
68 Black Rose of Chaos, Lady Miriyan Kerr a Terran Master
69 Arcane Complexificationer Daare, Seeke a Terran Master
70 Dallam Lighthawk a Terran Master
71 Vortok, Arcane Hunter a Terran Master
72 Archfiend Tenchu Corten Ax'Zuma a Terran Master
73 Fhyn Azon a Terran Master
74 Elysian Kail a Terran Master
75 Sir Pwyll, Cleric of Phaestus a Terran Master
76 Fidelis Tacasti Moonflair, Mystic Hunt a Terran Master
77 Ashtan's One and Only Beggar Sgueg Sol a Terran Master
78 Rage of the Earth Qwilleran Yuridja, A a Terran Master
79 "Mr Cat" Codere Whisperwind a Terran Master
80 Cheery Flambe, Sir Aelis, Liquor Soake a Terran Master
81 Scarlatti's Dancing Queen, Kariana Win a Terran Master
82 Arcane Hunter Sirus Gothfraidh a Terran Master
83 Prythe Lanthe, her Shrubbery a Terran Master
84 Deonymus TijuLena, the Rainbow Fox a Terran Master
85 Vittorio Azon, Adherent of Light a Terran Master
86 Sir Brandilar Weltsdown, of clan Alesw a Terran Master
87 Jah Selassie a Terran Master
88 Iocun, Daisei of the Mind a Terran Master
89 Archdruid Ysbaddaden Oorangi, Landscap a Continental Wanderer
90 Rainbow Chaser, Alyjo Windsong a Continental Wanderer
91 Tonic 'Geno' Andgin Toreiil a Continental Wanderer
92 Lady Schisstae Lighthawk, Nymph of Bit a Continental Wanderer
93 Ethereal Guardian, Xio Windsong, Ponti a Continental Wanderer
94 Guild Scout Tommy a'Bertal a Continental Wanderer
95 Leonidas a Continental Wanderer
96 Jaded Axemaiden Cattiva de'Adamas a Continental Wanderer
97 Vardoulacha a Continental Wanderer
98 Toby Earendil a Continental Wanderer
99 Shakti Devi, the Queen of Swords a Continental Wanderer
100 Kohai Trae, The Incredible Bulk a Continental Wanderer
101 Apprentice of the Nakedstrut, Nitro Re a Continental Wanderer
102 Neran'thos Pelagia, Blaise Hayabusa, C a Continental Wanderer
103 Qui'anar Ablar Saer'rac-Yusef a Continental Wanderer
104 Downy Druid Delphinus Windancer, the T a Continental Wanderer
105 Shadownymph Rosaleen`Dhu a Continental Wanderer
106 Merchant Prince Emergo Le'Murzen a Continental Wanderer
107 Quaero Fontis Akila Mercadia-Ta'sa a Continental Wanderer
108 Caleth Le'Murzen a Continental Wanderer
109 Arcane Ascetic, Lysistrata Seir-Jinx a Continental Wanderer
110 Mayhem Aramar, Axiom of Enlightenment a Continental Wanderer
111 Heartsong Rhalia-Tlaiaqaal a Continental Wanderer
112 Lupine Wolf, Kered Ta'sa a Continental Wanderer
113 Scout Krypton Urth'Auren a Continental Wanderer
114 Tempest Tsavonglah, the Eye of the Sto a Continental Wanderer
115 Wanna-be Balloon Scientist Pert, Full a Continental Wanderer
*******************************************************************************
EXPLORERS 116 for more.


as you can see it should stick at 89...NOT 100...most of them work correctly, but Continental Wanderer, adn a few others do not, again because aparently my system thinks 89>100

This set of triggers is something i've worked very hard on and hope that someone can help me permanently fix it..and not just force me to manually go in and fix it every time i come across the breaks
Reply with quote
Pega
Magician


Joined: 08 Jan 2001
Posts: 341
Location: Singapore

PostPosted: Tue Mar 23, 2004 10:54 am   
 
Ooh another puzzle Wink

When you put quotes around %1 in the #IF statement, the > seems to treat it as a string.

There are two alternatives:
  • Use an %eval(), #if %eval(%item( @levelRank, %ismember( %2, @level)) > "%1") {...}.

  • Take away the quotes. In this case the quotes are not needed since the value captured is always an uncomplicated number.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Tue Mar 23, 2004 1:11 pm   
 
What Pega said. The quotes around %1 make it treat it as a string comparison. In this case "89" is bigger than "100" because "1" comes before "8" alphabetically.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Mar 23, 2004 3:47 pm   
 
While it has nothing to do with the problem, you might find that a record-variable works as well or better than a pair of list-variables.
#CLASS {ExplorerRankFind|rank}
#ADDKEY level {Sightseer|Vagabond|Itinerant|Rambler|Nomad|Wayfarer|Voyager|Landstrider|Forestwalker|Searcher of Horizons|Vashnarian Climber|Penetrator of the Depths|Desert Roamer|Hunter of the Lost World|Continental Wanderer|Terran Master|Sapient Explorer|Questor of the Far Reaches|Hadionic Seeker|Achaean Ranger} 999999
#TRIGGER {^(%d) * ({@level})$} {#IF (%db( @level, %2) > %1) {#ADDKEY level {%2} %1}}
#CLASS 0
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