Lasaqus Posted June 15, 2010 Share Posted June 15, 2010 I am working through a code for a MTGO Bot bit by bit to get it to work ( The code itself was initialy posted on here, saying people could use it so I hope its ok) I am currently at this part in the code expandcollapse popupFunc GetPlayer() ;Get the player's Name Dim $miDoc, $Doc Dim $str Dim $oWord Dim $sArray[500] Dim $count Dim $miLayout ;take screenshot $sTargetImage = @DesktopDir & "\New Smartbot\Player_tgt.jpg" _ScreenCapture_Capture($sTargetImage, 37, 260, 291, 289, $fCursor = False);233 $miDoc = ObjCreate("MODI.Document") $miDocView = ObjCreate("MiDocViewer.MiDocView") $Viewer = GUICreate ( "Embedded MODI Viewer", 640, 580,(@DesktopWidth-640)/2, (@DesktopHeight-580)/2) GUICtrlCreatePic ( $sTargetImage, 320, 290, 0, 0) GUICtrlSetResizing ($Viewer, $GUI_DOCKAUTO) GUISetBkColor(0xFFFFFF) GUISetState () $MiDocView.Document = $miDoc $MiDocView.SetScale (1, 1) _ScreenCapture_Capture($sTargetImage, 250, 250, 750, 600, $fCursor = False) GUISetState (@SW_HIDE) $miDoc.Create(@DesktopDir & "\New Smartbot\Player_tgt.jpg") $miDoc.Ocr($miLANG_ENGLISH, True, False) $i = 0 For $oWord in $miDoc.Images(0).Layout.Words $str = $str & $oWord.text & @CrLf ConsoleWrite("FROM GETPLAYER: " & $oWord.text & @CrLf) $sArray [$i] = $oWord.text $i += 1 Next return $sArray [0] EndFunc Currently the bot is failing at GUISetBkColor(0xFFFFFF) GUISetState () $MiDocView.Document = $miDoc <--------------HERE $MiDocView.SetScale (1, 1) _ScreenCapture_Capture($sTargetImage, 250, 250, 750, 600, $fCursor = False) With this error C:\XXXX\XXXXX\XXXXX\ (New).au3 (296) : ==> Variable must be of type "Object".: $MiDocView.Document = $miDoc $MiDocView^ ERROR I am no expert at Autoit and i am just learning as i go but currently this problem has me stumped Hope i provided enough info, if not i can provide more Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 15, 2010 Moderators Share Posted June 15, 2010 Lasaqus,Did you see the announcement at the top of the forum? If not you can read it here.I do think you are going to have a lot of help. Why not try and do something more useful with AutoIt than botting a game? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Lasaqus Posted June 15, 2010 Author Share Posted June 15, 2010 Lasaqus,Did you see the announcement at the top of the forum? If not you can read it here.I do think you are going to have a lot of help. Why not try and do something more useful with AutoIt than botting a game? M23I did read that, since bots are allowed to run in MTGO i assumed that it would be ok to post this here.I also have read alot of post on MTGO bots and it was also from the Autoit forum i came across the code.Am i allowed to have the post or shall i delete it. ? Link to comment Share on other sites More sharing options...
RAWBERRY Posted June 15, 2010 Share Posted June 15, 2010 According to the announcement you are allowed to post this. Someone needs to take a look back at the announcement himself. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 15, 2010 Moderators Share Posted June 15, 2010 Lasaqus,I have just quickly looked at the Terms for MTGO (a few minutes wasted from my life I will never recover ) and I see:"You agree not to engage in any of the following: (a) use any automated means, including, without limitation, agents, robots, scripts, or spiders"So where do you get the idea that:bots are allowed to run in MTGOLike I said - why not do something useful with Autoit instead? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Developers Jos Posted June 15, 2010 Developers Share Posted June 15, 2010 According to the announcement you are allowed to post this. Someone needs to take a look back at the announcement himself.Let me see whether I understand this correctly: You are seriously telling Melba23 to read the announcement? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Lasaqus Posted June 15, 2010 Author Share Posted June 15, 2010 Lasaqus,I have just quickly looked at the Terms for MTGO (a few minutes wasted from my life I will never recover ) and I see:"You agree not to engage in any of the following: (a) use any automated means, including, without limitation, agents, robots, scripts, or spiders"So where do you get the idea that:Like I said - why not do something useful with Autoit instead? M23Becuase i play MTGO alot and there are umpteen bots running for automated trades, also the various posts within MTGO's own forums for bot programs and such Link to comment Share on other sites More sharing options...
Developers Jos Posted June 15, 2010 Developers Share Posted June 15, 2010 Becuase i play MTGO alot and there are umpteen bots running for automated trades, also the various posts within MTGO's own forums for bot programs and suchWhich part of it not being allowed here is difficult to understand? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Lasaqus Posted June 15, 2010 Author Share Posted June 15, 2010 I don't want to get into any arguement here. I have read the terms of use and also the code of conduct and unable to find the link or information you provided. My case is http://www.wizards.com/Magic/TCG/Article.aspx?x=magic/magiconline/coc (Code of Conduct) http://wizards.custhelp.com/cgi-bin/wizards.cfg/php/enduser/std_adp.php?p_faqid=1358 (Terms of Service) Unless i haven't noticed there isn't anything stated with either ToC or CoC stating the non-use of bots These topics also discuss MTGO Bots and none where closed http://www.autoitscript.com/forum/index.php?showtopic=35496 http://www.autoitscript.com/forum/index.php?showtopic=75303 http://www.autoitscript.com/forum/index.php?showtopic=87084 (this is the post i got my code from to try and fix) Link to comment Share on other sites More sharing options...
Developers Jos Posted June 15, 2010 Developers Share Posted June 15, 2010 Click SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Recommended Posts