Jump to content
Sign in to follow this  
para

Trying to make a bot that responds to commands.

Recommended Posts

Declare them first, before you use them.

Local $Varname, $Varname

At the top before you use them.


"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.

Share this post


Link to post
Share on other sites

Well.... I cant seem to figure this out, i figured out the declaring part, but now it wont even open the file.

Opt("WinTitleMatchMode", 3)

Local $var1, $var2, $var3, $var4

$var1 = WinExists("Untitled - Notepad", "!run notepad")
$var2 = WinExists("Untitled - Notepad", "!run paint")
$var3 = WinExists("Untitled - Notepad", "!run calc")
$var4 = WinExists("Untitled - Notepad", "!run cmd")

While 1

If $var1 = 1 Then
Run("notepad.exe")
EndIf

If $var2 = 1 Then
Run("mspaint.exe") 
EndIf

If $var3 = 1 Then
Run("calc.exe") 
EndIf

If $var4 = 1 Then
Run("cmd.exe")
EndIf

WEnd
Edited by para

Share this post


Link to post
Share on other sites

Make sure you start using ControlGetText :idiot: GL


"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.

Share this post


Link to post
Share on other sites

Open what file?

Use ControlGetText.


"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.

Share this post


Link to post
Share on other sites

It wont open notepad when I type !run notepad

Ok... Here is my edited version, tell me what I did wrong please.

Opt("WinTitleMatchMode", 3)

Local $var1, $var2, $var3, $var4

$var1 = WinExists("Untitled - Notepad", "!run notepad")
$var2 = WinExists("Untitled - Notepad", "!run paint")
$var3 = WinExists("Untitled - Notepad", "!run calc")
$var4 = WinExists("Untitled - Notepad", "!run cmd")

While 1

ControlGetText("Untitled - Notepad", "", 15)

If $var1 = 1 Then
Run("notepad.exe")
EndIf

If $var2 = 1 Then
Run("mspaint.exe") 
EndIf

If $var3 = 1 Then
Run("calc.exe") 
EndIf

If $var4 = 1 Then
Run("cmd.exe")
EndIf

WEnd

Share this post


Link to post
Share on other sites

You're not using ControlGetText right. You're not even setting a variable to return it to, for one.

The first variables from winexists and stuff you should ditch.. you're only checking them one time outside the loop, they need to be inside.

You didn't add the sleep I said, I give up -.-


"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.

Share this post


Link to post
Share on other sites

I remeber you saying add sleep, I felt no need to add it yet. I will add that when its a finished product....

How do I set a return value?


Share this post


Link to post
Share on other sites

I haven't read through all of the posts directly, so I'm not sure if this has been stated yet.

You might want to implement this as a perl bot. Perl has easy features for communicating with chat interfaces and you could probably couple a few features with autoit.

I have several chat bots that I created for Anarchy Online that answer, respond to tells and even send link blogs that show gui popup information while online. If you need some examples, just search google for bots and anarchy online.

Hope this helps..


[font="Optima"]"Those who heed life with speculation and contemplation, are the ones stuck home with constipation." - Joel[/font]

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...