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


Joined: 29 May 2003
Posts: 6
Location: USA

PostPosted: Tue Jun 17, 2003 12:10 am   

Modifying a Variable being used in a Trigger
 
Is there a way to modify a Var that's being used in a trigger?

Example: There is a ranking scheme, and I know that my team is ranked 10th, I want a trigger that takes my Var that holds my rank, then -1 from it, to match on the team in front of me, and then pull info outta there display so I can determine what I need to beat them. Make sense?

Like:


rank team Exp
8 Frogs 1,000,000
9 Dogs 500,000
10 Llamas 250,000

I already have the 10 stored in a Var , now I want to take that Var, -1 to get the person that's ranked right before me, then match on their Exp and do a Diff between their Exp and Mind(which I have already in another var).

Thanks... beating my head on this , prolly easy ...

Wherever you go, there you are.
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Tue Jun 17, 2003 4:12 am   
 
Here you go my friend thanks for all the fun :)



#CLASS {RankUm}
#VAR exppntsthem {Dogs|Frogs}
#VAR teams {Frogs|Dogs}
#VAR myteams {Llamas}
#VAR exppntsthemct {500000|1000000}
#VAR myteamct {250000}
#VAR teamnumct {2}
#VAR themnames {Dogs|Frogs} {}
#VAR mustget {250000|750000}
#TRIGGER {(%d) ({@teams}) (%n)} {#addi exppntsthem %2;#addi exppntsthemct %3;#addi themnames "%2"}
#TRIGGER {(%d) ({@myteams}) (%n)} {#var myteamct "";#var myteamct %3;#var teamnumct %numitems(@themnames);#forall @exppntsthemct {#addi mustget %abs(%i-@myteamct)};#loop 1,@teamnumct {#echo you have %item(@mustget,%i) to chetch up to %item(@themnames,%i)};#var exppntsthem "";#var exppntsthemct "";#var myteamct "";#var teamnumct "";#var themnames "";#var mustget ""}
#CLASS 0

#CLASS {RankUm|Help}
#ALIAS ruaddteams {#addi teams %1}
#ALIAS ruaddmyteams {#addi myteams %1}
#ALIAS rushowall {#forall @teams {#echo %i};#echo %ansi(high,yellow)_____________________________________________________;#forall @myteams {#echo %i}}
#ALIAS rushowteams {#forall @teams {#echo %i};#echo %ansi(high,yellow)_____________________________________________________}
#ALIAS rushowmyteams {#forall @myteams {#echo %i};#echo %ansi(high,yellow)_____________________________________________________}
#ALIAS rudelall {#yesno "This will permanently delete all your RankUm files, are you sure?" {#var teams "";#var myteams "";#echo %ansi(high,red)All your Rankum files have now been deleted!!}}
#ALIAS rudelteams {#yesno "This will permanently delete all your RankUm files, are you sure?" {#var teams "";#echo %ansi(high,red)Your Rankum files on Teams have now been deleted!!}}
#ALIAS rumyteams {#yesno "This will permanently delete all your RankUm files, are you sure?" {#var myteams "";#echo %ansi(high,red)Your Rankum files on MyTeams have now been deleted!!}}
#ALIAS ruhelp {#echo _______________________________________________________________________________________;#echo ruaddteams %ansi(high,yellow)Will add new Teams;#echo ruaddmyteams %ansi(high,yellow)Will add Names to your MyTeams list;#echo rushowall %ansi(high,yellow)Will Show you both Teams and MyTeams;#echo rushowteams %ansi(high,yellow)Will Show you just the Teams list;#echo rushowmyteams %ansi(high,yellow)Will Show you just your MyTeam list;#echo rudellall %ansi(high,red)Will Delete both Teams and MyTeams records permanently;#echo rudelteams %ansi(high,red)Will Delete just the Teams record Permanently;#echo rudelmyteams %ansi(high,red)Will Delete just the MyTeams record permanently;#echo ruhelp %ansi(high,yellow)Will Show you This Help File again;#echo _______________________________________________________________________________________}
#CLASS 0



Any questions?

megamog75
I will do this.Nothing in my life matters except this.No moment in my life exists except this moment.I am born in this moment, and if I fail, I will die in this moment.
-Raistlin Majere
Reply with quote
Banzai
Newbie


Joined: 29 May 2003
Posts: 6
Location: USA

PostPosted: Tue Jun 17, 2003 4:32 am   
 
Woops, I gave a generic basic Example of what I wanted and you did all that work. Now let me show you specific example :(

In a clan, you have Ratings.. here is a rating of a clan
pts (Ranking)

Clantown Rating: 101 (8)
Trading Rating: 10128 (52)
Exp Rating: 1793403 (33)
Eq Rating: 2442 (39)
Egg Rating: 8428 (40)
TownGame Rating: 1145 (39)

Now then, I already have a script that takes these values and saves them in Vars.. 2 sets actually.. 1 is a baseline saved , the 2nd is the actual values at that moment, then I do a simple subtract old values from New values to determine if we're gaining Pts or losing them.. Simple? Right

now then, each of these rankings you can see a specific list for. I will use the Exp rating now for an example

28 [ 2107546][ 75][ Balron] Nomads of the Lost Faith
29 [ 2103817][ 80][ Krilith] The Twilight Corsairs
30 [ 2067272][104][ Torajio] Despotic Order of Assassins
31 [ 1880060][ 20][ Mandroth] Lords of Discipline
32 [ 1843362][ 7][ Anssett] The Cheese Merchants of Medievia
33 [ 1793028][ 1][ Pelle] Circle of Power
34 [ 1711067][ 42][ Xanthus] The House of Swords and Magic
35 [ 1705593][ 87][ Ryathe] Spirit of the Dragon
36 [ 1685812][ 11][ Reven] The Hollow
37 [ 1660848][ 38][ Ardant] Wraiths of Ruin


Now you will see, the clan I picked was rated at 33rd.. so I wanted to take my var that has this ranking (33) subtract 1 from it, making it 32 then capture the Exp Points that 32 has, and subtract my Pts from theirs, to see basically the Gap in Pts between Me and Them, so I would be able to guage what it takes to overtake them in that category. Mind you I plan on doing this for ALL the various ratings...

Does this make sense? Sorry if it doesn't.. I have an idea on how to do it all, but trying ot use my already existent Variable storing my Ranking, and subtracting 1 from it, and then using that Var in a Trigger.. yanno?

Wherever you go, there you are.
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Tue Jun 17, 2003 4:42 am   
 
AS my buddy Raistlin says, no good deed goes unpunished.

make an alias that can pull %itmem from your already exsistin @vars and do the #math and there you go.

megamog75
I will do this.Nothing in my life matters except this.No moment in my life exists except this moment.I am born in this moment, and if I fail, I will die in this moment.
-Raistlin Majere
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