jvanegmond Posted February 8, 2006 Share Posted February 8, 2006 (edited) I've been messing around with this for about a week looking for ways around this but i didn't find any as good as this if it would work.. When i use PixelSearch and it doesnt find anything it sets @error to "1" but when it does has succes does it set @error back to "0" or Empty? This is the code, please look into it, and tell me what i can do better.. Sorry for the {TAB}s hehe While 1 PixelSearch ( $ertscoord1[0] - 10, $ertscoord1[1] + 10, $ertscoord1[0] + 20, $ertscoord1[1] - 20, $ertskleur1, 5) If Not @Error Then MouseClick( "Left" , $ertscoord1[0] , $ertscoord1[1], Random(1,2,1)) Tooltip(" Mijn 1 " , 0 , 0 ) Sleep(4000) $keer = $keer + 1 Else PixelSearch ( $ertscoord2[0] - 20, $ertscoord2[1] + 20, $ertscoord2[0] + 20, $ertscoord2[1] - 20, $ertskleur2, 5) If Not @error Then MouseClick( "Left" , $ertscoord2[0] , $ertscoord2[1], Random(1,2,1)) Tooltip(" Mijn 2 " , 0 , 0 ) Sleep(4000) $keer = $keer + 1 Else If $keer = "20" Then Drop() Else Sleep(100) Tooltip(" Sleep " , 0 , 0 ) EndIf EndIf EndIf WEnd Edited February 8, 2006 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
Nuffilein805 Posted February 8, 2006 Share Posted February 8, 2006 it should set @error back to 0 or blank, but as i'm not sure here i'd suggest that you give your pixelsearch a variable to write in so you can check the variable, but i'm not sure if this works for sure just have a try my little chatmy little encryption toolmy little hidermy unsafe clickbot Link to comment Share on other sites More sharing options...
jvanegmond Posted February 8, 2006 Author Share Posted February 8, 2006 (edited) it should set @error back to 0 or blank, but as i'm not sure here i'd suggest that you give your pixelsearch a variable to write in so you can check the variable, but i'm not sure if this works for sure just have a try I had quite a few tries ( 20+ ) and if i want to check the variable like in $var = Pixelsearch etc. If $var[0] <> "" Then It will send back a error message $var[0] Not an array (or something like that... Edited February 8, 2006 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
jvanegmond Posted February 8, 2006 Author Share Posted February 8, 2006 I've tried to make it a bit smaller.. but it still doens't work.. While 1 $px1 = PixelSearch ( $ertscoord1[0] - 10, $ertscoord1[1] + 10, $ertscoord1[0] + 10, $ertscoord1[1] - 10, $ertskleur1, 5) If $px1 <> "" Then MouseClick("Left", $ertscoord1[0], $ertscoord1[1]) Sleep(4000) $px1 = "" $keer = $keer + 1 Else Sleep(100) EndIf If $keer = "8" Then Droppen() EndIf WEnd Basically... $px1 <> "" Doesnt work, because i need to check the array. However.. using $px[0] <> "" Doesn't work either, because it will send a error message telling that it's not a array. I've also tried making it an array but i'm very unsure about how this actually works.. How do make an array? How do i overwrite ( or delete + write ) data in a array? I've looked in help but it's unclear to me.. Examples please! github.com/jvanegmond Link to comment Share on other sites More sharing options...
pecloe Posted February 8, 2006 Share Posted February 8, 2006 Dim $array[3] $array[0] = "one" $array[1] = "two" $array[2] = "three" MsgBox(0, "", $array[0] & " " & $array[1] & " " & $array[2]) real basic Link to comment Share on other sites More sharing options...
pecloe Posted February 8, 2006 Share Posted February 8, 2006 try this While 1 $px1 = PixelSearch ( $ertscoord1[0] - 10, $ertscoord1[1] + 10, $ertscoord1[0] + 10, $ertscoord1[1] - 10, $ertskleur1, 5) If Not @error Then MouseClick("Left", $pxl[0], $pxl[1]) Sleep(4000) $keer = $keer + 1 Else Sleep(100) EndIf If $keer = "8" Then Droppen() EndIf WEnd Link to comment Share on other sites More sharing options...
jaenster Posted February 8, 2006 Share Posted February 8, 2006 manadar , wat wil je doen , ik help je wel . -jaenster Link to comment Share on other sites More sharing options...
jvanegmond Posted February 8, 2006 Author Share Posted February 8, 2006 try thisDoesn't work i've tried it from the beginning, but then i looked for solutions github.com/jvanegmond Link to comment Share on other sites More sharing options...
jaenster Posted February 8, 2006 Share Posted February 8, 2006 Maby you need to read my tut .. maby you got some of it -jaenster Link to comment Share on other sites More sharing options...
jvanegmond Posted February 8, 2006 Author Share Posted February 8, 2006 (edited) I think it's a bug of some sort... Dim $px1[1] $px1[0] = "1" While 1 If $px1[0] <> "1" Then MsgBox(0, "Uuh", "1") Else MsgBox(0, "Uuh", "2") EndIf WEnd This works as it should... This however doesn't: Dim $px1[1] $px1[0] = "1" While 1 $px1 = PixelSearch ( 10, 10, 20, 20, 0xFFFFFF, 5) If $px1[0] <> "1" Then MsgBox(0, "Uuh", "1") Else MsgBox(0, "Uuh", "2") EndIf WEnd Error message: arrays.au3 (7) : ==> Subscript used with non-Array variable.: What on Earth should i do about this? Edited February 8, 2006 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
jaenster Posted February 8, 2006 Share Posted February 8, 2006 wtf? -jaenster Link to comment Share on other sites More sharing options...
jvanegmond Posted February 8, 2006 Author Share Posted February 8, 2006 Yes it's very strange... When a Pixelsearch failes, it doesn't only set @error to 1 but it also deletes the entire array? github.com/jvanegmond Link to comment Share on other sites More sharing options...
jaenster Posted February 8, 2006 Share Posted February 8, 2006 he didn't ... he only overwrite the old var , Del the old .. Make then an new , If its faild he makes one Without arrays -jaenster Link to comment Share on other sites More sharing options...
jvanegmond Posted February 8, 2006 Author Share Posted February 8, 2006 Yea i see what you mean... This is what it does Del var that i'm assigned to store data in Search for pixel in assigned region if it does work then write in var if it doesn't work then end I'd rather have it do this: Search for pixel if works del var write var if doesn't then end Anyway, can't have that done ... So are there ways around this? Please think with me cause i am seriously stunned github.com/jvanegmond Link to comment Share on other sites More sharing options...
jaenster Posted February 8, 2006 Share Posted February 8, 2006 Yes , if its not worked the var is del too -jaenster Link to comment Share on other sites More sharing options...
jvanegmond Posted February 8, 2006 Author Share Posted February 8, 2006 Dim $px11[1], $px1[1] $px1[0] = "1" While 1 $px11 = PixelSearch ( 10, 10, 20, 20, 0xFFFFFF, 5) If Not @error Then $px1 = $px11 EndIf If $px1[0] <> "1" Then MsgBox(0, "Uuh", "1") Else MsgBox(0, "Uuh", "2") EndIf WEnd I think this worked github.com/jvanegmond Link to comment Share on other sites More sharing options...
pecloe Posted February 8, 2006 Share Posted February 8, 2006 i tried this in scite (its a white screen) and it worked While 1 $px = PixelSearch ( 590, 590, 600, 600, 0xFFFFFF, 10) If @error Then MsgBox(0, "Uuh", "pixel not found") Else MsgBox(0, "Uuh", $px[0] & "," & $px[1]) EndIf WEnd Link to comment Share on other sites More sharing options...
jvanegmond Posted February 8, 2006 Author Share Posted February 8, 2006 (edited) Dim $px, $pxcheck While 1 $px = PixelSearch ( 461, 334, 496, 378, 0xFFFFFF, 5) If Not @error Then $pxcheck = "1" EndIf If $pxcheck = "1" Then MsgBox(0, "Message", "Center is white") Else MsgBox(0, "Message", "Center is not white") EndIf $pxcheck = "0" WEnd Hellbound Hackers h4xx u ass off. Edited February 21, 2007 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
jvanegmond Posted February 8, 2006 Author Share Posted February 8, 2006 i tried this in scite (its a white screen) and it workedThanks for your help. But i really simplified this, i needed a way around that way of coding. github.com/jvanegmond Link to comment Share on other sites More sharing options...
pecloe Posted February 8, 2006 Share Posted February 8, 2006 sorry i couldn't help more phil Link to comment Share on other sites More sharing options...
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