Ok i hope someone can help me out with this...

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
powerinc
Newbie
Posts: 1
Joined: Tue Oct 10, 2006 7:16 am

Ok i hope someone can help me out with this...

Post by powerinc » Tue Oct 10, 2006 7:25 am

I play a video game. I would like help making a macro.
I want the macro to read from a text file: chat.log
Some of the chat log file looks like this:



*** Chat Log Opened: Mon Oct 09 23:48:54 2006

[23:48:54] To stop logging, type /chatlog again.
[23:48:58] Burrps casts a spell!
[23:49:03] Your share of the loot is 12 silver, and 74 copper pieces.
[23:49:03] Burrpak casts a spell!
[23:49:03] The forest heart casts a spell!
[23:49:03] @@[Party] Helilesbain: "please end now"
[23:49:04] The forest heart casts a spell!
[23:49:04] The forest heart casts a spell!
[23:49:04] The forest heart casts a spell!

*** Chat Log Closed: Mon Oct 09 23:55:23 2006

Notice i said: [23:49:03] @@[Party] Helilesbain: "please end now"

I want the macro to use ReadLn command to read the chat.log and when it sees "please end now" said, to end the macro it is tied into. Heres some things you need to know. In order for the chat log files to be updated, you have to type /chatlog. you type /chatlog once to begin logging, and again to stop logging and update the file. I want it to do this every 5 minutes or so, so it updates the log file. How would i make it so while it is looping a macro, have it check if "please end now" is said and when it is, stop macroing all together. If ReadLn isnt capable of this, can someone help me out with a way HOW to get this to work? Thanks!

User avatar
JRL
Automation Wizard
Posts: 3517
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Wed Oct 11, 2006 3:01 pm

Try something like this:

Code: Select all

Label>start
//Since you're sending text to an app you must
//make sure you're focused on the proper window.
Set>SomeWindowName

//start the chatlog
Send>/chatlog

//Wait 5 minutes
Wait>300

//Set Focus on the proper window again.
Set>SomeWindowName

//Stop the chatlog
Send>/chatlog

//Reading the whole chatlog file at once is faster
//and easier to deal with.
ReadFile>ChatlogFileName,ChatFile

//I like to use Separate> to search through text
//If the separate count is greater than 1 you have a match
Separate>ChatFile,please end now,var
If>var_count>1,end,start
Label>end
Good luck,
Dick

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts