Jump to content

Error , and i dont know why.


 Share

Recommended Posts

What i wand to do:

Mouse move to 1-2-3-4, when run after first if dont find pixel on color 2 to stop utill il show up.

Need to use some dll and why after until color 2 program not continue only stay and click same point?

Func Me1()
While 1
$Color1 = 0X77CAEB ; 463, 36
$Color2 = 0xB4C19E ; 164, 270
$errColor2 = 0xC58744 ; 164, 277
$Color3 = 0x41B28 ; 633, 213

$Color1 = PixelSearch (463, 36, 800, 600, 0X77CAEB, 0, 4); Color 1!!!!
if Not @error Then
MouseClick ( "Left" , $Color1[0] + Random(1, 5), $Color1[1] - Random(1, 5), 1 , random(3, 7))
Sleep(Random(1000, 1500))
If PixelGetColor(164, 270) <> "0xB4C19E" Then ; Color 2
Do

Sleep(Random(1000, 1500))
MouseMove(164 + Random(1,3),270 + Random(1,3), random(5, 9))
Sleep(Random(500, 1000))
MouseClick ( "Left", 164 + Random(1,3),270 + Random(1,3), 1)
Sleep(Random(500, 1000))
Until PixelGetColor(164, 270) = "0xB4C19E" ; Color 2 Here i want to stop on Run 2 utill color Error Finish?


;Here stop not move next?

If PixelGetColor(633, 213) <> "0x41B28" Then; Color 3
Do

Sleep(Random(500, 1000))
MouseMove (633 + Random(1,3),213 + Random(1,3), random(5, 9))
Sleep(Random(500, 1000))
MouseClick ( "Right", 633 + Random(1,3), 213 + Random(1,3), 1)
Sleep(Random(1000, 2000))
Until PixelGetColor(633, 213) = "0x41B284" ; Color 3




If PixelGetColor(436, 36) <> "0X77CAEB" Then ; Color 1
Do
Sleep(Random(500, 1000))
MouseMove(463 + Random(1,3),36 + Random(1,3), random(5, 9))
Sleep(Random(500, 1000))
MouseClick ( "Left", 463 + Random(1,3),36 + Random(1,3), 1)
Sleep(Random(500, 1000))
Until PixelGetColor(436, 36) = "0X77CAEB" ; Color 1


If @error Then

Do
Sleep(Random(500, 1000))
Until PixelGetColor(164, 270) = "0xB4C19E" ; Color 2 NOT Error


EndIf
EndIf
EndIf
EndIf
EndIf
EndIf
EndIf

WEnd
EndFunc
Link to comment
Share on other sites

Can you please tell us which program you try to automate?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

First, you should post working code, what you posted will throw errors.

If you want people to help you, don't make them have to work so hard

just to even have runnable code.

Second, add some error checking like msgbox or consolewrite to see where or why your code

is not doing what you expect.

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

this program try to automate.

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <Imagesearch.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>

#include <missions/Republic/JabiimEscort.au3>
#Region ### START Koda GUI section ### Form=C:UsersUserDesktopb1Form1.kxf
$Form1_1 = GUICreate("Swtor", 430, 309, 306, 186)
GUISetIcon("C:UsersUserDesktopb1imgimages.ico", -1)
$Pic1 = GUICtrlCreatePic("C:UsersUserDesktopb1imgHEADER.jpg", 0, 0, 444, 100)
$Tab1 = GUICtrlCreateTab(0, 104, 497, 193)
$TabSheet1 = GUICtrlCreateTabItem("Republic Daily")
$Button1 = GUICtrlCreateButton("[20] Midnight Freedom", 73, 168, 118, 25)
$Button2 = GUICtrlCreateButton("[24] Searing Light", 73, 196, 118, 25)
$Button3 = GUICtrlCreateButton("[28] Noble Gambit", 73, 223, 118, 25)
$Button4 = GUICtrlCreateButton("[32] Ardent Wave", 73, 250, 118, 25)
$Button7 = GUICtrlCreateButton("[48] New Eclipse", 266, 252, 118, 25)
$Button8 = GUICtrlCreateButton("[44] Grand Nova", 266, 225, 118, 25)
$Button9 = GUICtrlCreateButton("[40] Sunder Zero", 266, 198, 118, 25)
$Button10 = GUICtrlCreateButton("[36] Glory Cyclone", 266, 170, 118, 25)
$Label1 = GUICtrlCreateLabel("Republic Daily Missions", 150, 140, 153, 20)
GUICtrlSetFont(-1, 10, 400, 0, "Verdana")
$Icon1 = GUICtrlCreateIcon("C:UsersUserDesktopb1imgRepublic.ico", -1, 120, 136, 24, 24)
$TabSheet2 = GUICtrlCreateTabItem("Empire Daily")
$Button12 = GUICtrlCreateButton("[15] Silent Roar", 73, 168, 118, 25)
$Button13 = GUICtrlCreateButton("[24] Echo Quake", 73, 196, 118, 25)
$Button14 = GUICtrlCreateButton("[28] Eternal Domain", 73, 223, 118, 25)
$Button15 = GUICtrlCreateButton("[32] Molten Splinter", 73, 250, 118, 25)
$Button16 = GUICtrlCreateButton("[48] Ascendant Pride", 266, 252, 118, 25)
$Button17 = GUICtrlCreateButton("[44] Raging Dawn", 266, 225, 118, 25)
$Button18 = GUICtrlCreateButton("[40] Sweeping Menace", 266, 198, 118, 25)
$Button19 = GUICtrlCreateButton("[36] Rising Fury", 266, 170, 118, 25)
$Label2 = GUICtrlCreateLabel("Empire Daily Missions", 150, 140, 142, 20)
GUICtrlSetFont(-1, 10, 400, 0, "Verdana")
$Icon2 = GUICtrlCreateIcon("C:UsersUserDesktopb1imgempire.ico", -1, 120, 136, 24, 24)

; Start combo-----------------------------------------
$TabSheet3 = GUICtrlCreateTabItem("Crew Craft")
$Button5 = GUICtrlCreateButton("Start", 328, 264, 91, 25)
$ActivateCrewSkills = GUICtrlCreateCheckbox("On/Off", 328, 240, 97, 17)
$CrewMember1 = GUICtrlCreateCheckbox("CrewMember1", 30, 168, 97, 17)
$CrewMember2 = GUICtrlCreateCheckbox("CrewMember2", 30, 227, 97, 17)
$CrewMember3 = GUICtrlCreateCheckbox("CrewMember3", 30, 207, 97, 17)
$CrewMember4 = GUICtrlCreateCheckbox("CrewMember4", 30, 188, 97, 17)
$CrewMember5 = GUICtrlCreateCheckbox("CrewMember5", 30, 246, 97, 17)
$CrewMember6 = GUICtrlCreateCheckbox("CrewMember6", 30, 266, 97, 17)
$LEFT = GUICtrlCreateRadio("LEFT", 144, 168, 57, 17)
$MIDDLE = GUICtrlCreateRadio("MIDDLE", 144, 192, 57, 17)
$RIGHT = GUICtrlCreateRadio("RIGHT", 144, 216, 65, 17)
;combo STAFF------------------------------------------

$TabSheet6 = GUICtrlCreateTabItem("Missions Space")
GUICtrlSetState(-1,$GUI_SHOW)
$Combo1 = GUICtrlCreateCombo("Republic Missions", 40, 168, 137, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, " [15] Fondor Escort | [15] Javaal Fleet Action| [15] Balosar Outpost | [20] Archenar Interception| [20] Makem Te Assault| [28] Syvris Evacuation| [28] Llanic Station Strike| [34] Pakuuni Defense| [34] Kovor Ice Field | [40] Hydian Way Blockade| [40] Drexel Sweep | [44] Kalee Fortification| [44] Zosha Advance | [48] Impossible Sector ")
$Combo3 = GUICtrlCreateCombo("Empire Missions", 256, 168, 137, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, " [15] Jabiim Escort| [15] Cartel Listening Station| [15] Saleucami Fleet Action| [20] Nez Peron Sweep| [20] Sarapin Assault| [28] Taspan Ambush| [28] Ezran Outpost | [34] Skaross Fortification| [34] Mugaar Ice Field | [40] Polith Minefield| [40] Sullust Interception | [44] Aeten Defense | [44] Clouds of Vondoru | [48] Ascendancy Barrier ")
$Button6 = GUICtrlCreateButton("Start", 328, 264, 91, 25)
$Icon3 = GUICtrlCreateIcon("C:UsersUserDesktopb1imgempire.ico", -1, 232, 166, 24, 24)
$Icon4 = GUICtrlCreateIcon("C:UsersUserDesktopb1imgRepublic.ico", -1, 16, 166, 24, 24)
$TabSheet4 = GUICtrlCreateTabItem("FlashPoints")
GUICtrlCreateTabItem("")
$Graphic1 = GUICtrlCreateGraphic(0, 296, 539, 24)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x000000, 0x000000)
GUICtrlSetGraphic(-1, $GUI_GR_RECT, -7, 0, 541, 16)

GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

;================================
Global $Paused
HotKeySet("{ESC}", "Terminate")
HotKeySet("{f2}", "TogglePause")
HotKeySet("{f1}", "Crew")
;===============================
$count = 0
$stop = False


Func TogglePause()
$Paused = NOT $Paused
While $Paused
sleep(100)
ToolTip('Script is "Paused"',0,0)
WEnd
ToolTip("")
EndFunc

Func Terminate()
Exit 0
EndFunc





While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

Case $Button5
If $count = 1 Then
GUICtrlSetData($Button5, "Start")
$count = 0

ElseIf $count = 0 Then
GUICtrlSetData($Button5, "Stop")
$count = 1
WS()

EndIf


EndSwitch
WEnd


Func WS()
WinActivate("Star Wars™: The Old Republic™")
WinMove("Star Wars™: The Old Republic™", "", 0, 0, 1024, 768)
Sleep (500)
EndFunc



$ActivateCrewSkills = IniRead("Config.ini", "Crewskills", "On/Off", "") ;load INI
If $ActivateCrewSkills = 1 Then GUICtrlSetState($ActivateCrewskills, $GUI_CHECKED)
$CrewMember1 = IniRead("Config.ini", "Crewmembers", "1", "")
If $CrewMember1 = 1 Then GUICtrlSetState($CrewMember1, $GUI_CHECKED)
$CrewMember2 = IniRead("Config.ini", "Crewmembers", "2", "")
If $CrewMember2 = 1 Then GUICtrlSetState($CrewMember2, $GUI_CHECKED)
$CrewMember3 = IniRead("Config.ini", "Crewmembers", "3", "")
If $CrewMember3 = 1 Then GUICtrlSetState($CrewMember3, $GUI_CHECKED)
$CrewMember4 = IniRead("Config.ini", "Crewmembers", "4", "")
If $CrewMember4 = 1 Then GUICtrlSetState($CrewMember4, $GUI_CHECKED)
$CrewMember5 = IniRead("Config.ini", "Crewmembers", "5", "")
If $CrewMember5 = 1 Then GUICtrlSetState($CrewMember5, $GUI_CHECKED)
$CrewMember6 = IniRead("Config.ini", "Crewmembers", "6", "")
If $CrewMember6 = 1 Then GUICtrlSetState($CrewMember6, $GUI_CHECKED)
$LEFT = IniRead("Config.ini", "Position", "Left", "")
If $LEFT = 1 Then GUICtrlSetState($LEFT, $GUI_CHECKED)
$MIDDLE = IniRead("Config.ini", "Position", "Middle", "")
If $MIDDLE = 1 Then GUICtrlSetState($MIDDLE, $GUI_CHECKED)
$RIGHT = IniRead("Config.ini", "Position", "Right", "")
If $RIGHT = 1 Then GUICtrlSetState($RIGHT, $GUI_CHECKED)


Func Accept()


Do
MouseMove(980+ Random(1,3),39 + Random(1,3), random(5, 9))
Sleep(Random(1000, 1500))
$var2=PixelSearch (800, 454, 1024, 768, 0x0A70AE)
If $var2=1 Then
MouseClick ( "Left", 800 + Random(1,3),454 + Random(1,3), 1)
Sleep(Random(1000, 1500))
EndIf

Until $var2=0

EndFunc




Func go()
WinActivate("Star Wars™: The Old Republic™")
Crew()
EndFunc

Func Crew() ;Crewskills Main function



If GUICtrlRead($CrewMember1) = $GUI_CHECKED Then
Crewcheck1()
Member1()

EndIf



EndFunc
Func Crewcheck1()


$x2 = 0
$y2 = 0

$x18 = 0
$y18 = 0





Do

MouseMove(593+ Random(1,3),37 + Random(1,3), random(5, 9))
Sleep(Random(1000, 1500))
$var2=PixelSearch (800, 454, 1024, 768, 0x0A70AE)



If $var2=1 Then

$var3=PixelSearch (800, 454, 1024, 768, 0x0A70AE)
EndIf


MouseClick ( "Left", 593 + Random(1,3),38 + Random(1,3), 1)
Sleep(Random(1000, 1500))


Until $var3=0




EndFunc

Func Member1()

$var4=PixelSearch (250, 330, 1024, 768, 0x081822) ; click crewmember 1
If $var4=0 And GUICtrlRead($CrewMember1) = $GUI_CHECKED Then

If GUICtrlRead($RIGHT) = $GUI_CHECKED Then
MouseMove(208+ Random(1,3),342 + Random(1,3), random(5, 9))
MouseClick ( "Left", 208 + Random(1,3),342 + Random(1,3), 1)
Sleep(Random(1000, 1500))
MouseMove(790+ Random(1,3),273 + Random(1,3), random(5, 9))
MouseClick ( "Right", 790 + Random(1,3),273 + Random(1,3), 1)
EndIf
EndIf
EndFunc
Link to comment
Share on other sites

Hi, even if not an aimbot, this is still automating a game.

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

  • Moderators

StuparuIG,

Please read the Forum Rules - particularly the bit about not discussing game automation - before you post again. Thread locked. :naughty:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...