Jump to content

Recommended Posts

Posted

I'm writing a macro for a text based game. I need a code that would read the text on the screen and act according to the text. Tried the wingettext and controlgettext but it didnt work properly.

While 1

Opt("WinWaitDelay",100)

Opt("WinTitleMatchMode",4)

Opt("WinDetectHiddenText",1)

Opt("MouseCoordMode",0)

WinWait("Shimlar - Service Pack 3 Internet Explorer","")

If Not WinActive("Shimlar - Service Pack 3 Internet Explorer","") Then WinActivate("Shimlar - Service Pack 3 Internet Explorer","")

WinWaitActive("Shimlar - Service Pack 3 Internet Explorer","")

MouseMove(778,205)

MouseDown("left")

MouseUp("left")

Sleep(3000)

If WinGetText("Shimlar - Service Pack 3 Internet Explorer" [,"You aim for Soul of Corruption"] ) Then

MouseMove(829,220)

MouseDown("left")

MouseUp("left")

Sleep(3000)

elseIf WinGetText("Shimlar - Service Pack 3 Internet Explorer" [,"You attack A Soul of Corruption"] ) Then

MouseMove(829,220)

MouseDown("left")

MouseUp("left")

Sleep(3000)

If WinGetText("Shimlar - Service Pack 3 Internet Explorer" [,"Enemy is dead, R.I.P"] ) Then ExitLoop

endif

wend

it says syntaxx error, but thats the way i found it in the help file. Anyone help please

Posted

If WinGetText("Shimlar - Service Pack 3 Internet Explorer" [,"You aim for Soul of Corruption"] ) Then

elseIf WinGetText("Shimlar - Service Pack 3 Internet Explorer" [,"You attack A Soul of Corruption"] ) Then 

If WinGetText("Shimlar - Service Pack 3 Internet Explorer" [,"Enemy is dead, R.I.P"] ) Then ExitLoop
ok those 3 lines have the square brakets in them the [ and ], you do NOT put those in the line, that is just a programming syntax reference to that item being optional.

so they should be like this in the same order you have them...

If WinGetText("Shimlar - Service Pack 3 Internet Explorer" ,"You aim for Soul of Corruption" ) Then

elseIf WinGetText("Shimlar - Service Pack 3 Internet Explorer" ,"You attack A Soul of Corruption" ) Then 

If WinGetText("Shimlar - Service Pack 3 Internet Explorer" ,"Enemy is dead, R.I.P" ) Then ExitLoop

Hope you understand, and this corrects your problem.

Laterzzz,

Onoitsu2

Things I have made:[font="Trebuchet Ms"]_CheckTimeBlock UDF(LT)MOH Call Ignore List (MOH = Modem On Hold)[/font]

Posted

What sort of text based game is it? Is this an Online MUD?

If so, it would probably be better to set your mud client to output to a textfile and have your autoit script read that logfile and act accordingly.

But then, if you wanted that... and it IS a mud, why not just use a fully featured MUD client with triggers built in ? :think:

AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)
Posted

What sort of text based game is it? Is this an Online MUD?

If so, it would probably be better to set your mud client to output to a textfile and have your autoit script read that logfile and act accordingly.

But then, if you wanted that... and it IS a mud, why not just use a fully featured MUD client with triggers built in ? :think:

from looking at his code it has mouseclicks, so I don't think it is a mud, and probably is not in realtime, or is a turn based, or "reload" based game, i imagine something like how neopets operates its "World"

Laterzzz,

Onoitsu2

Things I have made:[font="Trebuchet Ms"]_CheckTimeBlock UDF(LT)MOH Call Ignore List (MOH = Modem On Hold)[/font]

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...