|
voodoo Newbie
Joined: 16 Jun 2003 Posts: 1
|
Posted: Mon Jun 16, 2003 11:54 am
Looping macro getting data from a file. |
Hi.
Tipically I searched a tip for some extra description REALLY hard to find normally.
Assuming I have a file with a number of words (too long to create stringlist(s) easy to use), one word per line, how I can loop a command with this file and stop this when the output is not a specific output?
Example:
(launch macro)
zmudcommand: examine wordonelineoneofthefile
mud output: I can't do nuttin' for ya, man.
(go next word)
zmudcommand: examine wordtwolinetwoofthefile
mud output: I can't do nuttin' for ya, man.
(go next word)
zmudcommand: examine wordthreelinethreeofthefile
mud output: You can see something!
(stop)
I'm sure that is possible, but I'm absolutely too stupid.
Can you help me?
Voodoo |
|
|
|
megamog75 Enchanter
Joined: 20 Nov 2002 Posts: 627 Location: USA
|
Posted: Tue Jun 17, 2003 4:34 am |
This is easily soved, but I do want to state that it was not easy untill I created the only word speeling program for Zmud(bosting).
Just use my spelling word program but instead of using my file that contains the dictionary word list use you own "*,txt" document or whatever kind it is.
http://www.zuggsoft.com/forum/topic.asp?TOPIC_ID=10978&FORUM_ID=29&CAT_ID=1&Topic_Title=Spelling+word+Checker+for+ANYONE+and+any+language%21&Forum_Title=Finished+MUD+Scripts
I think this program will ask you to pick out the closest match and then it will actually replace it on the comand line for you to enter, but for your solution this is a great example of how to search a document.
If that is to much for you just create a macro and put this into it:
#file 1 "the_name_of_your_file.txt"
#var found ""
#var found %grep(1,"%1")
#if @found="" {#echo I can~'t do nuttin~' for ya~, man~.} {#echo You can see something~!}
#close 1
and that should do the trick!!!
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 |
|
|
|
|
|
|
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
|
|