awfstieg Posted September 8, 2018 Share Posted September 8, 2018 Hi, i made a code which contain: while 1 $get_costumer_data = PixelSearch(-498, 350, -366, 351, 0x254C1D, 1) If Not @error Then MouseClick ("left", $get_costumer_data[0], $get_costumer_data[1],1,1) ContinueLoop EndIf $correct = PixelSearch(-813, 356,-810, 361, 0x214866, 1) if not @error Then MouseClick ("left", -1196, 437,1,1) ContinueLoop EndIf $false = PixelSearch(-813, 356,-810, 361, 0xF36D25, 1) If Not @error Then MouseClick ("left", -474, 832,1,1) ;ask_for_new_data MouseClick("left", -267, 358, 1, 1) ;ban_user ContinueLoop EndIf WEnd i want to make $false to ;ask_for_new_data limited to 3 times, if it still get $false then ;ban_user, i've searched the forum but didn't get any result, help please. Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted September 8, 2018 Share Posted September 8, 2018 (edited) @awfstieg Increment a variable everytime you get into $false. When the variable reaches the value of 3, then do your action, else, do whatever you want to do Edited September 8, 2018 by FrancescoDiMuro Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
awfstieg Posted September 8, 2018 Author Share Posted September 8, 2018 2 hours ago, FrancescoDiMuro said: @awfstieg Increment a variable everytime you get into $false. When the variable reaches the value of 3, then do your action, else, do whatever ypu want to do Could you make an example how to add it? Link to comment Share on other sites More sharing options...
careca Posted September 8, 2018 Share Posted September 8, 2018 Maybe this? $var = 0 Do $false = PixelSearch(-813, 356,-810, 361, 0xF36D25, 1) If $false = @error Then ExitLoop Else $var = $var + 1 ConsoleWrite('ask_for_new_data - '&@MSEC&@CRLF) MouseClick("left", -474, 832,1,1) ;ask_for_new_data If $var = 3 Then ConsoleWrite('ban_user - '&@MSEC&@CRLF) MouseClick("left", -267, 358, 1, 1) ;ban_user EndIf EndIf Until $var = 3 Or $false <> @error There are many ways to do the same. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
pixelsearch Posted September 8, 2018 Share Posted September 8, 2018 @careca : i try to understand your script but something isn't clear for me. Could you please be so kind and explain it to me ? If $false = @error Then ExitLoop Else ... How could $false = @error ever happen because : 1) If the pixel is found, @error = 0, $false is now an array so testing $false and hoping it will be equal to 0 (or "" or False) to exit the loop, it will not work. 2) If the pixel is not found, @error = 1, $false = 0 . There too, ExitLoop will never happen. Also re-using @error in the last line of the script (the Until part of the loop) seems very dangerous, especially @error has been reset to 0 after each function of the Else statement (thanks to the help file) Personnally, i always add immediately a line like this, when I need to test @error later in the script : $iKeep_error = @error Then you can test $iKeep_error wherever you want, with an incredible peace of mind Link to comment Share on other sites More sharing options...
careca Posted September 8, 2018 Share Posted September 8, 2018 (edited) "How could $false = @error ever happen" Pixel is not found > @error, what is the doubt? Pixel is found, no error, so the code will jump to the else bit. 3) I see what you mean, it's a valid point, anyway this is to serve as a guide, something to build uppon. Edited September 8, 2018 by careca Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
awfstieg Posted September 8, 2018 Author Share Posted September 8, 2018 5 hours ago, careca said: Maybe this? $var = 0 Do $false = PixelSearch(-813, 356,-810, 361, 0xF36D25, 1) If $false = @error Then ExitLoop Else $var = $var + 1 ConsoleWrite('ask_for_new_data - '&@MSEC&@CRLF) MouseClick("left", -474, 832,1,1) ;ask_for_new_data If $var = 3 Then ConsoleWrite('ban_user - '&@MSEC&@CRLF) MouseClick("left", -267, 358, 1, 1) ;ban_user EndIf EndIf Until $var = 3 Or $false <> @error There are many ways to do the same. i'm sorry, i still confused. should i put $var & Do inside while? outside while? or replace while with do..until? it tried what you suggested but after ask_for_new_data happened 3 times and went back to the top it will do infinity loop again. p.s. please bear with me, i just started this scripting thingy days ago Link to comment Share on other sites More sharing options...
careca Posted September 8, 2018 Share Posted September 8, 2018 (edited) Did you set it up like this? While 1 $get_costumer_data = PixelSearch(-498, 350, -366, 351, 0x254C1D, 1) If Not @error Then MouseClick("left", $get_costumer_data[0], $get_costumer_data[1], 1, 1) ContinueLoop EndIf $correct = PixelSearch(-813, 356, -810, 361, 0x214866, 1) If Not @error Then MouseClick("left", -1196, 437, 1, 1) ContinueLoop EndIf ;============================================================================= $var = 0 ;we reset the var "count" to zero before the loop Do $false = PixelSearch(-813, 356, -810, 361, 0xF36D25, 1) If $false = @error Then ;found pixel so don't do any action and leave loop ExitLoop Else $var = $var + 1 ;increase var count ConsoleWrite('ask_for_new_data - ' & @MSEC & @CRLF) MouseClick("left", -474, 832, 1, 1) ;ask_for_new_data If $var = 3 Then ;if it's the third and last time in the loop, ban user. ConsoleWrite('ban_user - ' & @MSEC & @CRLF) MouseClick("left", -267, 358, 1, 1) ;ban_user EndIf EndIf Until $var = 3 Or $false <> @error ;leave loop if pixelsearch didn't give error, or it's the third loop. ;============================================================================= WEnd Edited September 8, 2018 by careca Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
markyrocks Posted September 9, 2018 Share Posted September 9, 2018 (edited) This is such a strange concept for me... how can someone be in an administrative position where they have the authority to possibly ban someone but yet it's based off of pixel search and generic mouse clicks?... I'd think any administrator would have access to more intuitive parts of a program or whatever the user is trying to access. This seems like an attempt to mask another program and make the user enter info and give like a pseudo ban by preventing the user from using the program Edited September 9, 2018 by markyrocks Spoiler "I Believe array math to be potentially fatal, I may be dying from array math poisoning" Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 9, 2018 Moderators Share Posted September 9, 2018 markyrocks, I quite agree - so why did you not report the thread so that the Mods are aware? We cannot see everything and it was purely by chance that I read this thread in detail. So in future please help us and use the "Report" button if you suspect anything. awfstieg, Given the doubts expressed above, please give some more details of just what you are trying to do and why you need to do it in such a roundabout way. M23 P.S. And just to be absolutely clear - because apparently it still needs to be emphasised: This is the Mod team determining the legality of the thread, so everyone else please keep out. FrancescoDiMuro 1 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...
awfstieg Posted September 9, 2018 Author Share Posted September 9, 2018 7 hours ago, markyrocks said: This is such a strange concept for me... how can someone be in an administrative position where they have the authority to possibly ban someone but yet it's based off of pixel search and generic mouse clicks?... I'd think any administrator would have access to more intuitive parts of a program or whatever the user is trying to access. This seems like an attempt to mask another program and make the user enter info and give like a pseudo ban by preventing the user from using the program 21 minutes ago, Melba23 said: markyrocks, I quite agree - so why did you not report the thread so that the Mods are aware? We cannot see everything and it was purely by chance that I read this thread in detail. So in future please help us and use the "Report" button if you suspect anything. awfstieg, Given the doubts expressed above, please give some more details of just what you are trying to do and why you need to do it in such a roundabout way. M23 P.S. And just to be absolutely clear - because apparently it still needs to be emphasised: This is the Mod team determining the legality of the thread, so everyone else please keep out. No, i'm not making a program to harm anyone. i'm currently making a game automaton to earn exp for myself. And i know that's ilegal, that's why i changed all the words in it. you can ban me after this. thank you for everything, and i am sorry. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 9, 2018 Moderators Share Posted September 9, 2018 (edited) awfstieg, No-one is going to ban you at the moment - just please stick to the Forum rules in future. Thread locked. M23 Edited September 9, 2018 by Melba23 Fixed formatting 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...
Recommended Posts