autocomplex Posted August 21, 2007 Posted August 21, 2007 (edited) I am making a PowerMining Script for the game Runescape. However, I currently have its mouse moves and mouseclicks predetermined regardles if they are actually the object I am Looking for. But I did add a trigger, that when a certain Block obtains this color the drop sequence begins. I want to change this a little bit. First the user defines the slot which will trigger the drop sequence, and the script has no predertimined mouseclicks or moves. When the trigger is recognized using a PixelSearch, It will begin search a predetermined area (or window) of them game. When the color is found it right clicks, and scrolls down 45 Pixels, and left clicks. Starting with the objects in the top left. It repeats its sequence until the final object, the trigger is dropped. If anyone has done somthing like this, or could teach me how; it would be appreciated. I was thinking I could have an Array with the Mouse Clicks and Mouse Moves or somthing, and the pixels change each time it finds the next one. But I dont know how to implement Arrays in this language. Edited August 21, 2007 by inline853 Want Runescape Specific Scripts and Bots?Visit AutoIt Runescape Team (ARST) forum!
ssubirias3 Posted August 21, 2007 Posted August 21, 2007 I am making a PowerMining Script for the game Runescape. However, I currently have its mouse moves and mouseclicks predetermined regardles if they are actually the object I am Looking for. But I did add a trigger, that when a certain Block obtains this color the drop sequence begins. I want to change this a little bit. First the user defines the slot which will trigger the drop sequence, and the script has no predertimined mouseclicks or moves. When the trigger is recognized using a PixelSearch, It will begin search a predetermined area (or window) of them game. When the color is found it right clicks, and scrolls down 45 Pixels, and left clicks. Starting with the objects in the top left. It repeats its sequence until the final object, the trigger is dropped. If anyone has done somthing like this, or could teach me how; it would be appreciated. I was thinking I could have an Array with the Mouse Clicks and Mouse Moves or somthing, and the pixels change each time it finds the next one. But I dont know how to implement Arrays in this language.Hmmm... interesting idea. I think you're on the right track and you should look into MouseGetPos since it returns the X,Y into an array. You could setup your screen coords like a map and those values be held in an array, prompting the user for the drop sequence (x,y) and use MouseMove and the coords from the arrays to move the mouse where you wanted. Read up on MouseGetPos and the example code in the help file. $pos = MouseGetPos() MsgBox(0, "Mouse x,y:", $pos[0] & "," & $pos[1])
autocomplex Posted August 21, 2007 Author Posted August 21, 2007 I still dont know how to implement Arrays, any help? Want Runescape Specific Scripts and Bots?Visit AutoIt Runescape Team (ARST) forum!
autocomplex Posted August 21, 2007 Author Posted August 21, 2007 (edited) ok i'm gonna try this ... but I almost know its wrong. If anyone could help me get this right. lol This is the Trigger $data = PixelSearch($smallx+2,$smally+42,$smallx+2+$smallScanWidth,$smally+42+$smallScanHeight,$DropColor,$Sens) If $data <> 1 Then Drop() EndIf This is the Drop Sequence Function Func Drop() While $data = PixelSearch($smallx+2,$smally+42,$smallx+2+$smallScanWidth,$smally+42+$smallScanHeight,$DropColor,$Sens) If $data <> 1 Then $pos = MouseGetPos() $pos = PixelSearch(810,175,602,175,$DropColor,$Sens) MouseMove($pos[0], $pos[1]) MouseClick( "right" [,$pos[0], $pos[1]]) MouseMove($pos[0], $pos[1]-45) MouseClick( "left" [,$pos[0], $pos[1]-45]) EndIf WEnd EndFunc Edited August 21, 2007 by inline853 Want Runescape Specific Scripts and Bots?Visit AutoIt Runescape Team (ARST) forum!
bogQ Posted August 21, 2007 Posted August 21, 2007 ok i'm gonna try this ... but I almost know its wrong. If anyone could help me get this right. lol This is the Trigger $data = PixelSearch($smallx+2,$smally+42,$smallx+2+$smallScanWidth,$smally+42+$smallScanHeight,$DropColor,$Sens) If $data <> 1 Then Drop() EndIf This is the Drop Sequence Function Func Drop() While $data = PixelSearch($smallx+2,$smally+42,$smallx+2+$smallScanWidth,$smally+42+$smallScanHeight,$DropColor,$Sens) If $data <> 1 Then $pos = MouseGetPos() $pos = PixelSearch(810,175,602,175,$DropColor,$Sens) MouseMove($pos[0], $pos[1]) MouseClick( "right" [,$pos[0], $pos[1]]) MouseMove($pos[0], $pos[1]-45) MouseClick( "left" [,$pos[0], $pos[1]-45]) EndIf WEnd EndFunc i dont think that this part is good $pos = MouseGetPos() $pos = PixelSearch(810,175,602,175,$DropColor,$Sens) becose you set the same variable 2 times with diffrent data use Func Drop() While $data = PixelSearch($smallx+2,$smally+42,$smallx+2+$smallScanWidth,$smally+42+$smallScanHeight,$DropColor,$Sens) If $data <> 1 Then $pos = PixelSearch(810,175,602,175,$DropColor,$Sens) MouseMove($pos[0], $pos[1]) MouseClick( "right" ,$pos[0], $pos[1]) MouseMove($pos[0], $pos[1]-45) MouseClick( "left" ,$pos[0], $pos[1]-45) EndIf WEnd EndFuncoÝ÷ ÚÚºÚ"µÍ[ÈÜ BUÚ[H ÌÍÙ]HH^[ÙXÚ ÌÍÜÛX[ Ì ÌÍÜÛX[JÍ ÌÍÜÛX[ ÌÉÌÍÜÛX[ØØ[ÚY ÌÍÜÛX[JÍÉÌÍÜÛX[ØØ[ZYÚ ÌÍÑÜÛÛÜ ÌÍÔÙ[ÊHBRY ÌÍÙ]H ÉÝÈH[ ÌÍÜÜÈH[ÝÙQÙ]ÜÊ B[ÝÙS[ÝJ ÌÍÜÜÖÌK ÌÍÜÜÖÌWJB[ÝÙPÛXÚÊ ][ÝÜYÚ ][ÝÈ ÌÍÜÜÖÌK ÌÍÜÜÖÌWJB[ÝÙS[ÝJ ÌÍÜÜÖÌK ÌÍÜÜÖÌWKM JB[ÝÙPÛXÚÊ ][ÝÛY ][ÝÈ ÌÍÜÜÖÌK ÌÍÜÜÖÌWKM JBBQ[YUÑ[[[ if you need data from your curent mouse position and data from your next pixelsearch then ser 2 diffrent variable names . $pos = MouseGetPos() $pos_1 = PixelSearch(810,175,602,175,$DropColor,$Sens) and the to use their data $pos[0],$pos[1] $pos_1[0],$pos_1[1] TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.
ssubirias3 Posted August 21, 2007 Posted August 21, 2007 ok i'm gonna try this ... but I almost know its wrong. If anyone could help me get this right. lolIts a little difficult for me to determine exactly what this is suppose to do since I don't game nor am familar with Runescape. From what you've provided I would make the following suggestions. Mainly so its easier to understand the code, imo. FROM: $data = PixelSearch($smallx+2,$smally+42,$smallx+2+$smallScanWidth,$smally+42+$smallScanHeight,$DropColor,$Sens) If $data <> 1 Then Drop() EndIf TO: Dim $left = $smallx+2, $top = $smally+42, $right = $smallx+2+$smallScanWidth, $bottom = $smally+42+$smallScanHeight $data = PixelSearch($left, $top, $right, $bottom, $DropColor, $Sens) If $data <> 1 Then Drop()oÝ÷ Ù.¬[§p:è¥Ú²}ý¶f¤zǧ±ëhë"Dz¢æ«zÞ¯ â¶)àÊ«Ó~©¢ Also having your conditional statement both inside and outside your function seems wrong, but I'm not sure what you're trying to do with you example code.
autocomplex Posted August 22, 2007 Author Posted August 22, 2007 yea dont know why I did that, but I fixed it. It is prolly my inexperience with this language, but even then it is evident it would serve no purpose. Any I solved the issue shortly after my last post, and have moved on to other aspects of the script. Thanks for the advice tho. Want Runescape Specific Scripts and Bots?Visit AutoIt Runescape Team (ARST) forum!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now