Jump to content

Need Some Serious Help Pretty Please!


MagickCrafter
 Share

Recommended Posts

Well, hey all.

I am currently working on creating a Magic Online Bot. (I explain further down if you do not know) I am progressing very far, however, I have run into to problems: (I am using AutoIt v3 btw)

Number 1:

I am trying to figure out what I can do to locate a PM window, display a message (I am not here right now, open trade etc), then close the window. (The PM window is practically just a window that pops up at a different place each time, in a diagonal pattern, when somebody PMs you) I have some code, but, umm, whenever it gets to this part of the code, my computer crashes due to memory problems I am assuming. (Please note that I am running this in a For loop about twenty or so times, so that may be it. But i NEED to do that to locate the PM.)

CODE:

$pm1 = 672

$pm2 = 123

$pm3 = 978

$pm4 = 555

$pm = 4338709

$privatemsg = "MagickCrafter's bot is currently running. I am trading 32 cards on this account for 1 ticket. If you have any problems please contact me at magickcrafter@hotmail.com Thank you!"

Func Privatemsg()

$private = PixelSearch($pm1, $pm2, $pm3, $pm4, $pm)

If Not @error Then

$pmcheckX = $private[0] - 117

$pmcheckY = $private[1] + 30

$pmcheck = PixelGetColor($pmcheckX, $pmcheckY)

If $pmcheck = 14605273 Then

$pmboX = $pmcheckX - 173

$pmboY = $pmcheckY + 140

SendMsg($privatemsg, $pmboX, $pmboY)

MouseClick("left", $private[0], $private[1])

EndIf

EndIf

EndFunc

Func SendMsg($a, $X, $Y)

Sleep(100)

ClipPut($a)

Sleep(100)

MouseMove($X, $Y)

MouseDown("left")

MouseUp("left")

Sleep(100)

Send("{CTRLDOWN}v{CTRLUP}{ENTER}")

Sleep(100)

MouseClick("left", $X, $Y, 2)

Sleep(100)

Send("{BACKSPACE}")

EndFunc

Problem number 2:

Whenever my bot sends text, it usually messes up. For example, if it is supposed to send the bot loading message, then the greeting message, it either displays the greeting message twice, the loading message and nothing else, etc. Is the sendmessage function messed up???

Thank you guys so much!

Link to comment
Share on other sites

Yes, This is the 'Scripts and Scraps' forum, this is where you post scripts n stuff. For support go to the Support forum.

Anyways, welcome to the forums!

Please look in the Help file located in your Autoit folder (C:\program files\Autoit) for pixelgetcolor()

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...