Jump to content
Sign in to follow this  
mrbig1479

magic online cards transfer script

Recommended Posts

mrbig1479

ok this is the script

the script is a cards transfer script between two magic online accounts running on the same computer.

i use this in case i have 2 or more acccount (i have 5) and i want to transfer say 1000+ cards from 1 account to the other account to sell in the account where i use a bot.

the only thing that need to setup manually is making the cards giving account that on the buddy list the lower one on the list

and also making sure that the account name fits

its my first script and i have a few questions

1. how can i make the program stop when i push a key?

2. is there a way to identify somthing writting on the magic online screen ( i cant use pixel search becouse the pixel are the same color)

3. i someone think on a better way to do some of the things here i would love to hear ( i new to scripting)

;set the title for both magic accounts

WinSetTitle ( "Magic Online V2.0.072.1873","","getcardsaccount")

WinSetTitle ( "Magic Online V2.0.072.1873","","givecardsaccount")

;maximize getcardsaccount window and also make main window

$j = 0

While $j <= 100

WinActivate( "getcardsaccount", "")

WinSetState( "getcardsaccount", "", @SW_MAXIMIZE )

MouseClick ( "left" , 70, 30 ,1)

;maximize givecardsaccount window and also make main window

WinActivate( "givecardsaccount", "")

WinSetState( "givecardsaccount", "", @SW_MAXIMIZE )

MouseClick ( "left" , 70, 30 ,1)

;and now we need to trade

WinActivate( "getcardsaccount", "")

;click my buddies

MouseClick ( "left" , 885, 730 ,2)

sleep (500)

;rightclick givecardsaccount name on the buddy list

MouseClick ( "right" , 176, 283 ,2)

sleep (500)

;select trade and click

MouseClick ( "left" , 224, 296 ,2)

;big sleep becouse of lags (20 sec should do it)

;-------------------------------------------------------------------------------------------

;; Wait until something changes in the region 0,0 to 50,50

; Get initial checksum

$checksum = PixelChecksum(350,250, 670,440)

; Wait for the region to change, the region is checked every 100ms to reduce CPU load

While $checksum = PixelChecksum(350,250, 670,440)

Sleep(100)

WEnd

;--------------------------------------------------------------------------------------------

WinActivate( "getcardsaccount", "")

; minimize the mybuddy window

sleep (1000)

$coord = PixelSearch( 0, 0, 1024, 700, 0xD7BA73 )

sleep (500)

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

;MouseClick ( "left" , 764, 88 ,1)

sleep (500)

WinActivate( "givecardsaccount", "")

;confirm the trade

$coord = PixelSearch( 0, 0, 1024, 700, 0x78CF7E )

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

;need loop for the cards transfer i choose 40 becouse i want to make sure the transfer should work

$failsafe = 0

while $failsafe =0

WinActivate( "getcardsaccount", "")

sleep (500)

$i = 0

While $i <= 50

MouseClick ( "left" , 415, 136 ,1)

sleep (1000)

$i = $i + 1

WEnd

;click to confirm the over 32cards for trade

$coord = PixelSearch( 0, 0, 1024, 700, 0x78CF7E )

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

;MouseClick ( "left" , 500, 415 ,1)

;press confirm for the trade on getcardsaccount for the cards transfer

MouseClick ( "left" , 240, 330 ,1)

MouseClick ( "left" , 160, 350 ,1)

sleep (500)

;double check

MouseClick ( "left" , 160, 350 ,1)

sleep (5000)

WinActivate( "givecardsaccount", "")

;making sure its on the trade window and not on the main window

MouseClick ( "left" , 475, 30 ,1)

sleep(2000)

$checksum = PixelChecksum(350,250, 670,440)

; Wait for the region to change, the region is checked every 100ms to reduce CPU load

;press confirm for the trade on givecardsaccount for the cards transfer

MouseClick ( "left" , 240, 332 ,1)

MouseClick ( "left" , 160, 350 ,1)

sleep(1000)

;double check

MouseClick ( "left" , 160, 350 ,1)

sleep (5000)

if $checksum = PixelChecksum(350,250, 670,440) then

$failsafe = 0

Else

$failsafe = 1

EndIf

WEnd

;pressing confirm to complate trade.

sleep (25000)

MouseClick ( "left" , 720,600 ,1)

WinActivate( "getcardsaccount", "")

sleep (15000)

MouseClick ( "left" , 720,600 ,1)

WinActivate( "getcardsaccount", "")

;pressing confirm for the trade completion on getcardsaccount account

sleep (15000)

MouseClick ( "left" , 614,422 ,2)

;pressing confirm for the new collection

sleep (10000)

$coord = PixelSearch( 0, 0, 1024, 700, 0x78D07E )

MouseClick ( "left" ,$coord[0],$coord[1] ,2)

WinActivate( "givecardsaccount", "")

;pressing confirm for the trade completion on givecardsaccount account

sleep (10000)

MouseClick ( "left" , 614,422 ,2)

$j = $j + 1

WEnd

Share this post


Link to post
Share on other sites
jokke

Q.1.A: HotKeySet

Q.2.A: There might bee. Usualy when this happends Pixelreading is blocked so you wont do exactly what you are trying to do.

Is it possible to change game into using Direct3D, this would make it able to pixelread it.

Q.3.A: Put [ autoit ] code goes here... [ /autoit ] tags around your code then we are actualy able to read code right off page.

Edited by jokke

UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.

Share this post


Link to post
Share on other sites
mrbig1479

ok thx for your replay - i added this function

HotKeySet("{ESC}", "Terminate")

Func Terminate()

Exit 0

EndFunc

thanks i didnt found it on the help files untill u told me its called hot key set.

about the pixel reading i think i can do a lot of staff like

if pixel x,y =xxxxxxx and pixel x+1,y+1 =xxxxxxx and ...... and.....

i can real names and such -but its too complicated - i dont think thats the answer..

Share this post


Link to post
Share on other sites
csk

Dear mrbig1479

Can i have a look at your script please. Iam also on similar task and sincerely request you to help me on this.

If it is ok for you, will be able to send to my mail.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.