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


Joined: 01 Jan 2009
Posts: 35

PostPosted: Wed Feb 11, 2009 1:35 pm   

different result when i execute an alias [fixed]
 
i alway seem to get wierd results... the multiple variable thing and now this.

i've been logging all the gear enchanting i've been doing with the idea of generating statistics. well tonight i finally got down and wrote the code to process the logs.

the problem is, if i run the alias from the command line, i get different answers if right click on the alias and hit execute... and the command line one is giving the wrong answers. any thoughts?

jack

Code:

#alias sortlog {
#class farming
#file 1 brill_log.txt
#file 2 formatted_brill_log.txt
#file 3 sort_log.txt
#loop %filesize( 1) {
  #var templog %read( 1, %i)
  #var templog1 %trim( %word( @templog, 2))
  #var templog %remove( @templog1, @templog)
  #var templog %trim( %concat( @templog, "|", @templog1))
  #write 2 %trim( @templog)
  }
#class farming
#loop %filesize( 2) {#var brilllist %additem( %read( 2, %i), @brilllist)}
#var sortedlist %sort( @brilllist)
#VAR sortedlist %countlist( @sortedlist)
#LOOPDB @sortedlist {#call %write(3,%val %key)}
#close 1
#close 2
#exec playerinfo clear
#loop %eval( %filesize( 3) / 3) {
  #var brill %word( %read( 3, %1), 1)
  #var fade %word( %read( 3, %eval( %1+1)), 1)
  #var vape %word( %read( 3, %eval( %1+2)), 1)
  #var day %trim( %item( %read( 3, %eval( %i*3)), 2))
  #var month %trim( %item( %read( 3, %eval( %i*3)), 3))
  #exec playerinfo + day of @day month of @month chance to brill is |br|%format( 2, %eval( %float( @brill)/(@brill + @fade + @vape)*100))~%|n| ~(%eval( @brill + @fade + @vape)~)
  }
#close 3
#exec playerinfo show

}


Last edited by jackwest on Wed Feb 11, 2009 5:05 pm; edited 1 time in total
Reply with quote
Leitia
Adept


Joined: 04 May 2007
Posts: 292
Location: Boston

PostPosted: Wed Feb 11, 2009 4:30 pm   
 
I have seen different behavior from command line variables doing that; like if I right click an alias in settings, %1 was never %null(%1), while it always was null as it should be from the command line. I concluded that settings are not ever executed by right clicking, that that ability is convenient but not as relevant to the system.


The work load you are doing with the %word function is suspect to me, I don't use %word as a given, ever. It seems particular to low volume.

With Notepad++ you can mark the lines with enchant stuff, then delete every other line but enchant lines, use regex, macros, and a replace variable, remove endlines, you can do this:

text:

With arcane utterances you enchant boots to glow +21 agility

find regex:
.+ enchant (\w+) to glow

replace regex:
enchant marker object is \1

returns:
enchant marker object is boots +21 agility

I am really bad at giving examples but wanted to show how you can move words around.

this replace

enchant \1 marker object is \1|
returns:
enchant boots marker object is boots| +21 agility

which I just can't do usually


Notepad++ is as particular as ZMud, it is free though, and if you want to play with text it is a bit awesome. You would need to make several passes on a document to deeply process the format, but you can do that to all open documents. I'm a fan.

http://notepad-plus.sourceforge.net/uk/site.htm
Reply with quote
jackwest
Novice


Joined: 01 Jan 2009
Posts: 35

PostPosted: Wed Feb 11, 2009 5:07 pm   
 
Thanks for the reply leitia. although i'm sure it wasnt what you had in mind, you pointed me in the right direction... my %word syntax was incorrect, for some reason i had typed %1 instead of %i...

jack
Reply with quote
Leitia
Adept


Joined: 04 May 2007
Posts: 292
Location: Boston

PostPosted: Wed Feb 11, 2009 5:49 pm   
 
im glad i did something, being an agent of chaos i never know

(finally got aspell to work in notepad++ by edjucated guessing, i dont know why i want people to use the program, but i did really want that)
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