Jump to content
Sign in to follow this  
Golbez

help? key response

Recommended Posts

Golbez

one of my problems is when the _run hotkey is pressed when i press w it lags alittle then does what it should.

the second/main problem is when the w key is pressed again it does not stop sometimes. it just keeps sending w. how would i stop this?

#Include <Misc.au3>
  Global $sk, $skd, $mc, $mcdown, $msdrag, $pc, $wtextm, $wtitlem, $mc, $cc, $cm, $wsc
  Global $MonsterTextCol
  Global $usehokeys, $endkey, $startkey, $runkey, $gamedir, $gamename, $login, $password, $windowname
  Global $mainsleep, $serverdelay, $runsleep
  Global $serverx, $servery, $Servokx, $Servoky, $windowx, $windowy, $connectx, $connecty
  
  LoadIni()
  _Opt()
  Pause()        
  Func Pause()
      While 1
          Sleep($mainsleep)
      WEnd
  EndFunc
  Func OpenAndLogin()
      If WinExists($windowname) = 0 And WinExists("METIN II AUTO PATCH") = 0 then
          Run($gamedir & "\" & $gamename, $gamedir)
          WinWait($windowname, "StartGame")
      EndIf
      If WinActive($windowname) <> 1 Then WinActivate($windowname)
      ControlClick($windowname, "", "StartGame", "left")
          Sleep($serverdelay)
      WinWait($windowname)
          Sleep($serverdelay)
      WinMove($windowname, "", $windowx, $windowy)
          Sleep($serverdelay)
      MouseClick("left", $serverx, $servery)
      ;ControlClick($windowname, "", "", "left", 1, $serverx, $servery)
          Sleep($serverdelay)
      MouseClick("left", $Servokx, $Servoky)
      ;ControlClick($windowname, "", "", "left", 1, $Servokx, $Servoky)
          Sleep($serverdelay)
      If $login = "" then $login = InputBox("Set Login", "Please input your Login")
      ControlSend($windowname, "", "", $login & "{TAB}")
          Sleep($serverdelay)
      If $password = "" then $password = InputBox("Set Password", "Please input your Password")
      ControlSend($windowname, "", "", $password)
          Sleep($serverdelay)
      MouseClick("left", $connectx, $connecty)
      ;ControlClick($windowname, "", "", "left", 1, $connectx, $connecty)    
  EndFunc
  Func Terminate()
      Exit
  EndFunc
  Func LoadIni()
      ;Color
          $MonsterTextCol = IniRead(@ScriptDir & "\Metin.ini", "Color", "MonsterText", "")
      ;Delays
          $mainsleep = IniRead(@ScriptDir & "\Metin.ini", "Delays", "MainSleep", "") 
          $serverdelay = IniRead(@ScriptDir & "\Metin.ini", "Delays", "ServerDelay", "")
          $runsleep = IniRead(@ScriptDir & "\Metin.ini", "Delays", "RunDelay", "")
      ;Keys
          $usehokeys = IniRead(@ScriptDir & "\Metin.ini", "Other", "UseHotkeys", "")
          $endkey = IniRead(@ScriptDir & "\Metin.ini", "Keys", "ExitKey", "")
          $startkey = IniRead(@ScriptDir & "\Metin.ini", "Keys", "StartKey", "")
          $pausekey = IniRead(@ScriptDir & "\Metin.ini", "Keys", "PauseKey", "")
          $runkey = IniRead(@ScriptDir & "\Metin.ini", "Keys", "RunKey", "")
          If $usehokeys = 1 Then
              HotKeySet($endkey, "Terminate")
              HotKeySet($PauseKey,"Pause")
              ;HotKeySet($startkey, "OpenAndLogin")
              HotKeySet($runkey, "_run")
          EndIf
      ;Other
          $login = IniRead(@ScriptDir & "\Metin.ini", "Other", "Login", "")
          $password = IniRead(@ScriptDir & "\Metin.ini", "Other", "Password", "")
          $gamedir = IniRead(@ScriptDir & "\Metin.ini", "Other", "GameDir", "")
          $gamename = IniRead(@ScriptDir & "\Metin.ini", "Other", "GameExeName", "")
          $windowname = IniRead(@ScriptDir & "\Metin.ini", "Other", "WindowName", "")
      ;Opt
          ;Delays
              $sk = IniRead(@ScriptDir & "\Metin.ini", "Opt", "SendKeyDelay", "")
              $skd = IniRead(@ScriptDir & "\Metin.ini", "Opt", "SendKeyDownDelay", "")
              $mc = IniRead(@ScriptDir & "\Metin.ini", "Opt", "MouseClickDelay", "")
              $mcdown = IniRead(@ScriptDir & "\Metin.ini", "Opt", "MouseClickDownDelay", "")
              $msdrag = IniRead(@ScriptDir & "\Metin.ini", "Opt", "MouseClickDragDelay", "")
          ;Modes
              $pc = IniRead(@ScriptDir & "\Metin.ini", "Opt", "PixelCoordMode", "")
              $wtextm = IniRead(@ScriptDir & "\Metin.ini", "Opt", "WinTextMatchMode", "")
              $wtitlem = IniRead(@ScriptDir & "\Metin.ini", "Opt", "WinTitleMatchMode", "")
              $mc = IniRead(@ScriptDir & "\Metin.ini", "Opt", "MouseCoordMode", "")
              $cc = IniRead(@ScriptDir & "\Metin.ini", "Opt", "CaretCoordMode", "")
              $cm = IniRead(@ScriptDir & "\Metin.ini", "Opt", "ColorMode", "")
          ;Other
              $wsc = IniRead(@ScriptDir & "\Metin.ini", "Opt", "WinSearchChildren", "")
      ;Coords
          ;Select Server
              $server = IniRead(@ScriptDir & "\Metin.ini", "Other", "WhatServer", "")
              $windowx = IniRead(@ScriptDir & "\Metin.ini", "Coords", "WindowX", "")
              $windowy =  IniRead(@ScriptDir & "\Metin.ini", "Coords", "WindowY", "")
              $Servokx = IniRead(@ScriptDir & "\Metin.ini", "Coords", "ServerOkButtonX", "")
              $Servoky = IniRead(@ScriptDir & "\Metin.ini", "Coords", "ServerOkButtonY", "")
              If $server = 1 Then
                  $serverx = IniRead(@ScriptDir & "\Metin.ini", "Coords", "Server1X", "")
                  $servery = IniRead(@ScriptDir & "\Metin.ini", "Coords", "Server1Y", "")
              ElseIf $server = 2 then
                  $serverx = IniRead(@ScriptDir & "\Metin.ini", "Coords", "Server2X", "")
                  $servery = IniRead(@ScriptDir & "\Metin.ini", "Coords", "Server2Y", "")
              EndIf
              $connectx = IniRead(@ScriptDir & "\Metin.ini", "Coords", "ConnectButtonX", "")
              $connecty = IniRead(@ScriptDir & "\Metin.ini", "Coords", "ConnectButtonY", "")
  EndFunc
  Func _Opt()
      ;Delays 
          Opt("SendKeyDelay", $sk)
          Opt("SendKeyDownDelay", $skd)
          Opt("MouseClickDelay", $mc)
          Opt("MouseClickDownDelay", $mcdown)
          Opt("MouseClickDragDelay", $msdrag)
      ;Modes
          Opt("PixelCoordMode", $pc)
          Opt("WinTextMatchMode", $wtextm)
          Opt("WinTitleMatchMode", $wtitlem)
          Opt("MouseCoordMode", $mc)
          Opt("CaretCoordMode", $cc)
          Opt("ColorMode", $cm)
      ;Other
          Opt("WinSearchChildren", $wsc)
  EndFunc
  Func _run()
      While 1
          If _IsPressed("57") Then ;57 = w
              While 1
                  Send("{w down}")
                  Sleep($runsleep)
                  If _IsPressed("57") Then
                      Beep(500, 10)
                      Send("{w down}")
                      send("")
                      ExitLoop
                  EndIf    
              WEnd
          ElseIf _IsPressed("53") Then ;53 = s
              While 1
                  Send("{s down}")
                  Sleep($runsleep)
                  If _IsPressed("53") Then
                      Beep(500, 10)
                      Send("{s down}")
                      send("")
                      ExitLoop
                  EndIf    
              WEnd
          ElseIf _IsPressed("41") Then ;41 = a
              While 1
                  Send("{a down}")
                  Sleep($runsleep)
                  If _IsPressed("41") Then
                      Beep(500, 10)
                      Send("{a down}")
                      send("")
                      ExitLoop
                  EndIf    
              WEnd
          ElseIf _IsPressed("44") Then ;44 = d
              While 1
                  Send("{d down}")
                  Sleep($runsleep)
                  If _IsPressed("44") Then
                      Beep(500, 10)
                      Send("{d down}")
                      send("")
                      ExitLoop
                  EndIf    
              WEnd
          EndIf
          Sleep($mainsleep)
      WEnd
  EndFuncoÝ÷ Ú)âjëh×6[Color]
  MonsterText = 0xEB1609
  
  [Keys]
  ***************************************************************************************************
  ***                                                                                                ***
  ***            ! is equal to ALT                IE: !d  will send ALT + d                            ***
  ***            + is equal to SHIFT                IE: +!d will send SHIFT + ALT + d                    ***
  ***            ^ is equal to CTRL                                                                    ***
  ***                                                                                                ***
  ***************************************************************************************************
  ExitKey = {ESC}
  StartKey = {HOME}
  PauseKey = {INS}
  RunKey = {DEL}
  
  [Other]
  Login = 
  Password = 
  WhatServer = 1
  UseHotkeys = 1
  GameDir = C:\Program Files\Metin2
  GameExeName = metin2.exe
  WindowName = METIN2
  
  [Delays]
  MainSleep = 1000
  ServerDelay = 2000
  RunDelay = 1000
  
  [Opt]
  ***************************************************************************************************
  ***                        DO NOT EDIT IF YOU DO NOT KNOW WHAT YOU ARE DOING!                        ***
  ***************************************************************************************************
  ***                                                                                                ***
  ***            PixelCoordMode ------>    1=absolute, 0=relative, 2=client                            ***
  ***            WinTextMatchMode ---->    1=complete, 2=quick                                            ***
  ***            WinSearchChildren --->     0=no, 1=search children also                                ***
  ***            WinTitleMatchMode --->     1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase        ***
  ***            SendKeyDelay -------->     5 milliseconds                                                ***
  ***            SendKeyDownDelay ---->    1 millisecond                                                ***
  ***            MouseClickDelay ----->    10 milliseconds                                                ***
  ***            MouseClickDownDelay ->    10 milliseconds                                                ***
  ***            MouseClickDragDelay ->    250 milliseconds                                            ***
  ***            MouseCoordMode ------>    1=absolute, 0=relative, 2=client                            ***
  ***            CaretCoordMode ------>    1=absolute, 0=relative, 2=client                            ***
  ***            ColorMode ----------->    0=RRGGBB color, 1=BBGGRR color                                ***
  ***                                                                                                ***
  ***************************************************************************************************
  PixelCoordMode = 2
  WinTextMatchMode = 1
  WinSearchChildren =  1
  WinTitleMatchMode = 1
  SendKeyDelay = 1
  SendKeyDownDelay = 1
  MouseClickDelay = 10
  MouseClickDownDelay = 10
  MouseClickDragDelay = 250
  MouseCoordMode = 2
  CaretCoordMode = 2
  ColorMode = 0
  
  [Coords]
  WindowX = -1
  WindowY = -22
  ServerOkButtonX = 526
  ServerOkButtonY = 493
  Server1X = 520
  Server1Y = 360
  Server2X = 520
  Server2Y = 380
  ConnectButtonX = 585
  ConnectButtonY = 524

Share this post


Link to post
Share on other sites
Golbez

new problem.. im trying to find pixels but i dont get how to use the pixelsearch command..

these are the coords for the box:

coord1: x=390, y=242

coord2: x=395, y=247

this is what i got:

PixelSearch(390, 242, 395, 247, $fishcol, 5)

i dont think its working. i think the box is in the wroung spot but idk how to track it

Share this post


Link to post
Share on other sites
Somerset

new problem.. im trying to find pixels but i dont get how to use the pixelsearch command..

these are the coords for the box:

coord1: x=390, y=242

coord2: x=395, y=247

this is what i got:

PixelSearch(390, 242, 395, 247, $fishcol, 5)

i dont think its working. i think the box is in the wroung spot but idk how to track it

simple tracking and quick is move mouse to the coordinates that pixelsearch returns.. or save the coordinated to a file... Edited by beerman

 

Spoiler

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

Share this post


Link to post
Share on other sites
Golbez

simple tracking and quick is move mouse to the coordinates that pixelsearch returns.. or save the coordinated to a file...

uh :) how would i track it cause the info thing doesnt work very well on my game.

Share this post


Link to post
Share on other sites
Golbez

anyone got any suggestions on how i can make some of my code shorter/work better?

#Include <Misc.au3>
Global $sk, $skd, $mc, $mcdown, $msdrag, $pc, $wtextm, $wtitlem, $mc, $cc, $cm, $wsc
Global $MonsterTextCol, $fishcol, $fcoldif
Global $usehokeys, $endkey, $startkey, $runkey, $gamedir, $gamename, $login, $password, $windowname
Global $mainsleep, $serverdelay, $runsleep, $pulldelay, $fishdelay, $fixscreen
Global $serverx, $servery, $Servokx, $Servoky, $windowx, $windowy, $connectx, $connecty
Global $baitdelay, $baitkey1, $baitkey2, $castdelay, $fishkey, $fleft, $ftop, $fright, $fbottom, $setbait
Global $random1, $random2

LoadIni()
_Opt()
Pause()     
Func Pause()
    While 1
        Sleep($mainsleep)
    WEnd
EndFunc
Func OpenAndLogin()
    If WinExists($windowname) = 0 And WinExists("METIN II AUTO PATCH") = 0 then
        Run($gamedir & "\" & $gamename, $gamedir)
        WinWait($windowname, "StartGame")
    EndIf
    If WinActive($windowname) <> 1 Then WinActivate($windowname)
    ControlClick($windowname, "", "StartGame", "left")
        Sleep($serverdelay)
    WinWait($windowname)
        Sleep($serverdelay)
    WinMove($windowname, "", $windowx, $windowy)
        Sleep($serverdelay)
    MouseClick("left", $serverx, $servery)
    ;ControlClick($windowname, "", "", "left", 1, $serverx, $servery)
        Sleep($serverdelay)
    MouseClick("left", $Servokx, $Servoky)
    ;ControlClick($windowname, "", "", "left", 1, $Servokx, $Servoky)
        Sleep($serverdelay)
    If $login = "" then $login = InputBox("Set Login", "Please input your Login")
    ControlSend($windowname, "", "", $login & "{TAB}")
        Sleep($serverdelay)
    If $password = "" then $password = InputBox("Set Password", "Please input your Password")
    ControlSend($windowname, "", "", $password)
        Sleep($serverdelay)
    MouseClick("left", $connectx, $connecty)
    ;ControlClick($windowname, "", "", "left", 1, $connectx, $connecty) 
EndFunc
Func Fishing()
    If WinActive($windowname) <> 1 Then WinActivate($windowname)
    WinMove($windowname, "", $windowx, $windowy)
    Sleep(2000)
    MouseMove($fleft, $ftop)
    Sleep($fixscreen)
    While 1
        If WinActive($windowname) <> 1 Then WinActivate($windowname)
        $random1 = Random(1, 3, 1)  ;Bait rod
        If $random1 = 1 Then 
            Send($baitkey1)
        ElseIf $random1 = 2 Then
            Send($baitkey2) 
        ElseIf $random1 = 3 Then    
            $Random2 = Random(1, 2, 1)
            If $random2 = 1 Then
                Send($baitkey1)
            ElseIf $random2 = 2 Then
                Send($baitkey2)
            endif
        EndIf
        Sleep($baitdelay)
        Send($fishkey) ;Casting
        Sleep($castdelay)
        While 1
            If WinActive($windowname) <> 1 Then WinActivate($windowname)
            Sleep($fishdelay)
            $pullrod = PixelSearch($fleft, $ftop, $fright, $fbottom, $fishcol, $fcoldif)
            If Not @error Then ExitLoop
            $Random = Random(1, 2, 1)
            If $Random = 1 Then
                    MouseMove(50,50,0)
                    Sleep(10)
            ElseIf $Random = 2 Then
                    MouseMove(100,100,0)
                    Sleep(10)
            EndIf
        WEnd
        Sleep(100)
        Send($fishkey)
        Sleep($pulldelay)   
    WEnd
EndFunc
Func Terminate()
    Exit
EndFunc
Func LoadIni()
    ;Color
        $MonsterTextCol = IniRead(@ScriptDir & "\Metin.ini", "Color", "MonsterText", "")
        $fishcol = IniRead(@ScriptDir & "\Metin.ini", "Color", "Fishing", "")
        $fcoldif = IniRead(@ScriptDir & "\Metin.ini", "Color", "FishColorDifference", "")
    ;Delays
        $mainsleep = IniRead(@ScriptDir & "\Metin.ini", "Delays", "MainSleep", "") 
        $serverdelay = IniRead(@ScriptDir & "\Metin.ini", "Delays", "ServerDelay", "")
        $runsleep = IniRead(@ScriptDir & "\Metin.ini", "Delays", "RunDelay", "")
        $fishdelay = IniRead(@ScriptDir & "\Metin.ini", "Delays", "FishDelay", "")
        $pulldelay = IniRead(@ScriptDir & "\Metin.ini", "Delays", "RodPullDelay", "")
        $castdelay = IniRead(@ScriptDir & "\Metin.ini", "Delays", "RodCastDelay", "")
        $baitdelay = IniRead(@ScriptDir & "\Metin.ini", "Delays", "BaitDelay", "")
        $fixscreen = IniRead(@ScriptDir & "\Metin.ini", "Delays", "FixScreen", "")
    ;Keys
        $usehokeys = IniRead(@ScriptDir & "\Metin.ini", "Other", "UseHotkeys", "")
        $endkey = IniRead(@ScriptDir & "\Metin.ini", "Keys", "ExitKey", "")
        $startkey = IniRead(@ScriptDir & "\Metin.ini", "Keys", "StartKey", "")
        $pausekey = IniRead(@ScriptDir & "\Metin.ini", "Keys", "PauseKey", "")
        $runkey = IniRead(@ScriptDir & "\Metin.ini", "Keys", "RunKey", "")
        $startfishkey = IniRead(@ScriptDir & "\Metin.ini", "Keys", "StartFishingKey", "")
        $fishkey = IniRead(@ScriptDir & "\Metin.ini", "Keys", "FishingKey", "")
        $baitkey1 = IniRead(@ScriptDir & "\Metin.ini", "Keys", "BaitKey1", "")
        $baitkey2 = IniRead(@ScriptDir & "\Metin.ini", "Keys", "BaitKey2", "")
        If $usehokeys = 1 Then
            HotKeySet($endkey, "Terminate")
            HotKeySet($PauseKey,"Pause")
            ;HotKeySet($startkey, "OpenAndLogin")
            HotKeySet($runkey, "_run")
            HotKeySet($startfishkey, "Fishing")
        EndIf
    ;Other
        $login = IniRead(@ScriptDir & "\Metin.ini", "Other", "Login", "")
        $password = IniRead(@ScriptDir & "\Metin.ini", "Other", "Password", "")
        $gamedir = IniRead(@ScriptDir & "\Metin.ini", "Other", "GameDir", "")
        $gamename = IniRead(@ScriptDir & "\Metin.ini", "Other", "GameExeName", "")
        $windowname = IniRead(@ScriptDir & "\Metin.ini", "Other", "WindowName", "")
    ;Opt
        ;Delays
            $sk = IniRead(@ScriptDir & "\Metin.ini", "Opt", "SendKeyDelay", "")
            $skd = IniRead(@ScriptDir & "\Metin.ini", "Opt", "SendKeyDownDelay", "")
            $mc = IniRead(@ScriptDir & "\Metin.ini", "Opt", "MouseClickDelay", "")
            $mcdown = IniRead(@ScriptDir & "\Metin.ini", "Opt", "MouseClickDownDelay", "")
            $msdrag = IniRead(@ScriptDir & "\Metin.ini", "Opt", "MouseClickDragDelay", "")
        ;Modes
            $pc = IniRead(@ScriptDir & "\Metin.ini", "Opt", "PixelCoordMode", "")
            $wtextm = IniRead(@ScriptDir & "\Metin.ini", "Opt", "WinTextMatchMode", "")
            $wtitlem = IniRead(@ScriptDir & "\Metin.ini", "Opt", "WinTitleMatchMode", "")
            $mc = IniRead(@ScriptDir & "\Metin.ini", "Opt", "MouseCoordMode", "")
            $cc = IniRead(@ScriptDir & "\Metin.ini", "Opt", "CaretCoordMode", "")
            $cm = IniRead(@ScriptDir & "\Metin.ini", "Opt", "ColorMode", "")
        ;Other
            $wsc = IniRead(@ScriptDir & "\Metin.ini", "Opt", "WinSearchChildren", "")
    ;Coords
        ;Select Server
            $server = IniRead(@ScriptDir & "\Metin.ini", "Other", "WhatServer", "")
            $windowx = IniRead(@ScriptDir & "\Metin.ini", "Coords", "WindowX", "")
            $windowy =  IniRead(@ScriptDir & "\Metin.ini", "Coords", "WindowY", "")
            $Servokx = IniRead(@ScriptDir & "\Metin.ini", "Coords", "ServerOkButtonX", "")
            $Servoky = IniRead(@ScriptDir & "\Metin.ini", "Coords", "ServerOkButtonY", "")
            If $server = 1 Then
                $serverx = IniRead(@ScriptDir & "\Metin.ini", "Coords", "Server1X", "")
                $servery = IniRead(@ScriptDir & "\Metin.ini", "Coords", "Server1Y", "")
            ElseIf $server = 2 then
                $serverx = IniRead(@ScriptDir & "\Metin.ini", "Coords", "Server2X", "")
                $servery = IniRead(@ScriptDir & "\Metin.ini", "Coords", "Server2Y", "")
            EndIf
            $connectx = IniRead(@ScriptDir & "\Metin.ini", "Coords", "ConnectButtonX", "")
            $connecty = IniRead(@ScriptDir & "\Metin.ini", "Coords", "ConnectButtonY", "")
        ;Fishing
            $fleft = IniRead(@ScriptDir & "\Metin.ini", "Coords", "FishLeft", "")
            $ftop = IniRead(@ScriptDir & "\Metin.ini", "Coords", "FishTop", "")
            $fright = IniRead(@ScriptDir & "\Metin.ini", "Coords", "FishRight", "")
            $fbottom = IniRead(@ScriptDir & "\Metin.ini", "Coords", "FishBottom", "")
EndFunc
Func _Opt()
    ;Delays 
        Opt("SendKeyDelay", $sk)
        Opt("SendKeyDownDelay", $skd)
        Opt("MouseClickDelay", $mc)
        Opt("MouseClickDownDelay", $mcdown)
        Opt("MouseClickDragDelay", $msdrag)
    ;Modes
        Opt("PixelCoordMode", $pc)
        Opt("WinTextMatchMode", $wtextm)
        Opt("WinTitleMatchMode", $wtitlem)
        Opt("MouseCoordMode", $mc)
        Opt("CaretCoordMode", $cc)
        Opt("ColorMode", $cm)
    ;Other
        Opt("WinSearchChildren", $wsc)
EndFunc
Func _run()
    While 1
        If _IsPressed("57") Then ;57 = w
            While 1
                Send("{w down}")
                Sleep($runsleep)
                If _IsPressed("57") Then
                    Beep(500, 10)
                    Send("{w down}")
                    send("")
                    ExitLoop
                EndIf   
            WEnd
        ElseIf _IsPressed("53") Then ;53 = s
            While 1
                Send("{s down}")
                Sleep($runsleep)
                If _IsPressed("53") Then
                    Beep(500, 10)
                    Send("{s down}")
                    send("")
                    ExitLoop
                EndIf   
            WEnd
        ElseIf _IsPressed("41") Then ;41 = a
            While 1
                Send("{a down}")
                Sleep($runsleep)
                If _IsPressed("41") Then
                    Beep(500, 10)
                    Send("{a down}")
                    send("")
                    ExitLoop
                EndIf   
            WEnd
        ElseIf _IsPressed("44") Then ;44 = d
            While 1
                Send("{d down}")
                Sleep($runsleep)
                If _IsPressed("44") Then
                    Beep(500, 10)
                    Send("{d down}")
                    send("")
                    ExitLoop
                EndIf   
            WEnd
        EndIf
        Sleep($mainsleep)
    WEnd
EndFunc

Share this post


Link to post
Share on other sites
bogQ

anyone got any suggestions on how i can make some of my code shorter/work better?

how about instead
IniRead(@ScriptDir & "\Metin.ini", ...
4 every line on your ini file you use

#include <Array.au3>
$kmp = 0
$x = 0
$var = IniReadSectionNames("beep.ini")
For $i = 1 To $var[0]
    If $i = 1 Then $avArray = _ArrayCreate($var[$i])
    If $i <> 1 Then _ArrayAdd($avArray,$var[$i])
    $kmp = $kmp + 1
Next
Do
    $var1 = IniReadSection("beep.ini", $avArray[$x])
    For $b = 1 To $var1[0][0]
        Assign($var1[$b][0], $var1[$b][1])
    Next
    $x = $x + 1
Until $kmp = $x

and rename your variables from your ini to variables from script, so that in future youl not have any need to add

IniRead(@ScriptDir & "\Metin.ini", ...
on any new ini line you create if you need it

and bdw

***         PixelCoordMode ------>  1=absolute, 0=relative, 2=client                            ***
this can b read as key
***         PixelCoordMode ------>  1
with data on it
absolute, 0=relative, 2=client

i sugest you to edit it with

***         PixelCoordMode ------>  1 equal absolute, 0 equal relative, 2 equal client                          ***

or something like that

dont get me wrong, this r only suggestions and my apinion :)


TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
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.

 

Share this post


Link to post
Share on other sites
Golbez

anyone know how to fix the pixel problem.. i cant figure it out :)

Edited by Golbez

Share this post


Link to post
Share on other sites
bogQ

anyone know how to fix the pixel problem.. i cant figure it out :)

try the inline853 post, she have there nice exsample of tracking pixel on coordinates 400,250,600,350

Fix the fast Moving Box, Smooth the Movement

or do you need something else?


TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
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.

 

Share this post


Link to post
Share on other sites
Golbez

kinda.. but i dont need it to fallow the pixel.

Posted Image

i need to find one of the white pixels. the bubble is only there for a few seconds tho.

Share this post


Link to post
Share on other sites
bogQ

kinda.. but i dont need it to fallow the pixel.

i need to find one of the white pixels. the bubble is only there for a few seconds tho.

so r you saying that this isnt working in that game?

$fishcol = "0xFFFFFF";<== put the color you need
$fcoldif = "8";<== put the color difrance you need
While 1
    Sleep(100);<== put the time to search for the pixel 1000 = on every 1 second
    $did_i_Finde_it = PixelSearch(390, 242, 395, 247, $fishcol, $fcoldif)
    If $did_i_Finde_it <> 1 Then ;<== if its one then he dident finde it, if its not one he will return position coordinates on variable $did_i_Finde_it[0]  = x $$did_i_Finde_it[1]  = y 
        ToolTip("LoL man, i gotone")
        Else
        ToolTip("This Da..N Fishing, maby il need to start using TNT on them.")
    EndIf
WEnd

sry 4 this edit but

While 1
            If WinActive($windowname) <> 1 Then WinActivate($windowname)
            Sleep($fishdelay)
            $pullrod = PixelSearch($fleft, $ftop, $fright, $fbottom, $fishcol, $fcoldif)
            If Not @error Then ExitLoop

maby this is where its not working maby it shud b

If @error Then ExitLoop

?

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
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.

 

Share this post


Link to post
Share on other sites
Golbez

for some reason this is not working.. it is not sending f1 or f3 or f4 sometimes ;)

i cant seem to figure it out.

btw it finds the bubble fine :)... thanx

Func Fishing()
    $fishkey = "{F1}"
    $baitkey1 = "{F3}"
    $baitkey2 = "{F4}"
    $baitdelay = 5000
    $castdelay = 2500
    $fishdelay = 500
    $pulldelay = 3000
    If WinActive($windowname) <> 1 Then WinActivate($windowname)
    WinMove($windowname, "", $windowx, $windowy)
    ToolTip("     Locating Spot")
    Sleep(2000)
    MouseMove($fleft, $ftop)
    Sleep($fixscreen)
    MouseMove($fleft - 60, $ftop - 60)
    While 1
        If WinActive($windowname) <> 1 Then WinActivate($windowname)
        Sleep($switchwindow)
        $random1 = Random(1, 3, 1)     ;Bait rod
        Sleep(100)
        ToolTip("     Baiting")
        If $random1 = 1 Then 
            Send($baitkey1)
        ElseIf $random1 = 2 Then 
            Send($baitkey2)
        ElseIf $random1 = 3 Then 
            $Random2 = Random(1, 2, 1)
            If $random2 = 1 Then 
                Send($baitkey1)
            ElseIf $random2 = 2 Then 
                Send($baitkey2)
            EndIf
        EndIf
        ToolTip("     Casting")
        Sleep($baitdelay)
        Send($fishkey) ;Casting
        ToolTip("     Fishing")
        Sleep($castdelay)
        While 1
            Sleep($fishdelay)
            If WinActive($windowname) <> 1 Then WinActivate($windowname)
            $pullrod = PixelSearch(390, 242, 395, 247, $fishcol, $fcoldif)
            If $pullrod <> 1 Then
                ToolTip("     Catching Fish")
                Sleep(100)
                Send($fishkey)
                Sleep($pulldelay)
                ExitLoop
            EndIf
        WEnd
    WEnd
EndFunc

Share this post


Link to post
Share on other sites
bogQ

for some reason this is not working.. it is not sending f1 or f3 or f4 sometimes ;)

i cant seem to figure it out.

btw it finds the bubble fine :)... thanx

maby your problem is in window focus

did you try with

ControlSend("windowname", "", "", "{ENTER}")

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
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.

 

Share this post


Link to post
Share on other sites
Golbez

but dont i have to have a controlID?

Share this post


Link to post
Share on other sites
bogQ

but dont i have to have a controlID?

i never added cID before and it worked

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
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.

 

Share this post


Link to post
Share on other sites
Golbez

i never added cID before and it worked

its not working.. its not sending the commands... :)

edit:

Func Fishing()  
     $fishkey = "{F1}"
    $baitkey1 = "{F3}"
    $baitkey2 = "{F4}"
    $baitdelay = 5000
    $castdelay = 2500
    $fishdelay = 500
    $pulldelay = 3000
    $windowname = "METIN2"
     If WinActive($windowname) <> 1 Then WinActivate($windowname)
    WinMove($windowname, "", $windowx, $windowy)
    ToolTip("     Locating Spot")
    Sleep(2000)
    MouseMove($fleft, $ftop)
    Sleep($fixscreen)
    MouseMove($fleft - 60, $ftop - 60)
    While 1
        Sleep($switchwindow)
        $random1 = Random(1, 3, 1)     ;Bait rod
        Sleep(100)
        ToolTip("     Baiting")
        If WinActive($windowname) <> 1 Then WinActivate($windowname)
        If $random1 = 1 Then 
            ControlSend($windowname, "", "", $baitkey1)
        ElseIf $random1 = 2 Then
            ControlSend($windowname, "", "", $baitkey2)            
        ElseIf $random1 = 3 Then 
            $Random2 = Random(1, 2, 1)
            If $random2 = 1 Then 
                ControlSend($windowname, "", "", $baitkey1)
            ElseIf $random2 = 2 Then 
                ControlSend($windowname, "", "", $baitkey2)
            EndIf
        EndIf
        ToolTip("     Casting")
        Sleep($baitdelay)
        If WinActive($windowname) <> 1 Then WinActivate($windowname)
        ControlSend($windowname, "", "", $fishkey)
        ToolTip("     Fishing")
        Sleep($castdelay)
        While 1
            Sleep($fishdelay)
            If WinActive($windowname) <> 1 Then WinActivate($windowname)
            $pullrod = PixelSearch($fleft, $ftop, $fright, $fbottom, $fishcol, $fcoldif)
            ;$pullrod = PixelSearch(390, 242, 395, 247, $fishcol, $fcoldif)
            If $pullrod <> 1 Then
                ToolTip("     Catching Fish")
                Sleep(100)
                ControlSend($windowname, "", "", $fishkey)
                Sleep($pulldelay)
                ExitLoop
            EndIf
        WEnd
    WEnd
EndFunc
Edited by Golbez

Share this post


Link to post
Share on other sites
bogQ

its not working.. its not sending the commands

ahh i need togoto sleep, im downloading that game tonight, il try to see tomoro whats wrong with that fishing :)

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
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.

 

Share this post


Link to post
Share on other sites
Golbez

full code:

#Include <Misc.au3>
Global $sk, $skd, $mc, $mcdown, $msdrag, $pc, $wtextm, $wtitlem, $mc, $cc, $cm, $wsc
Global $MonsterTextCol, $fishcol, $fcoldif
Global $usehokeys, $endkey, $startkey, $runkey, $gamedir, $gamename, $login, $password, $windowname
Global $mainsleep, $serverdelay, $runsleep, $pulldelay, $fishdelay, $fixscreen, $bait
Global $serverx, $servery, $Servokx, $Servoky, $windowx, $windowy, $connectx, $connecty
Global $baitdelay, $baitkey1, $baitkey2, $castdelay, $fishkey, $fleft, $ftop, $fright, $fbottom, $setbait
Global $random1, $random2, $usesounds, $switchwindow, $pullrod

LoadIni()
_Opt()
Pause()     
Func Pause()
    While 1
        Sleep($mainsleep)
    WEnd
EndFunc
Func OpenAndLogin()
    If WinExists($windowname) = 0 And WinExists("METIN II AUTO PATCH") = 0 then
        Run($gamedir & "\" & $gamename, $gamedir)
        WinWait($windowname, "StartGame")
    EndIf
    If WinActive($windowname) <> 1 Then WinActivate($windowname)
    ControlClick($windowname, "", "StartGame", "left")
        Sleep($serverdelay)
    WinWait($windowname)
        Sleep($serverdelay)
    WinMove($windowname, "", $windowx, $windowy)
        Sleep($serverdelay)
    MouseClick("left", $serverx, $servery)
    ControlClick($windowname, "", "", "left", 1, $serverx, $servery)
        Sleep($serverdelay)
    MouseClick("left", $Servokx, $Servoky)
    ;ControlClick($windowname, "", "", "left", 1, $Servokx, $Servoky)
        Sleep($serverdelay)
    If $login = "" then $login = InputBox("Set Login", "Please input your Login")
    ControlSend($windowname, "", "", $login & "{TAB}")
        Sleep($serverdelay)
    If $password = "" then $password = InputBox("Set Password", "Please input your Password")
    ControlSend($windowname, "", "", $password)
        Sleep($serverdelay)
    MouseClick("left", $connectx, $connecty)
    ;ControlClick($windowname, "", "", "left", 1, $connectx, $connecty) 
EndFunc
Func Fishing()  
    If WinActive($windowname) <> 1 Then WinActivate($windowname)
    WinMove($windowname, "", $windowx, $windowy)
    ToolTip("     Locating Spot")
    Sleep(2000)
    MouseMove($fleft, $ftop)
    Sleep($fixscreen)
    MouseMove($fleft - 60, $ftop - 60)
    While 1
        Sleep($switchwindow)
        $random1 = Random(1, 3, 1)  ;Bait rod
        Sleep(100)
        ToolTip("     Baiting")
        If WinActive($windowname) <> 1 Then WinActivate($windowname)
        If $random1 = 1 Then 
            ControlSend($windowname, "", "", $baitkey1)
        ElseIf $random1 = 2 Then
            ControlSend($windowname, "", "", $baitkey2)         
        ElseIf $random1 = 3 Then 
            $Random2 = Random(1, 2, 1)
            If $random2 = 1 Then 
                ControlSend($windowname, "", "", $baitkey1)
            ElseIf $random2 = 2 Then 
                ControlSend($windowname, "", "", $baitkey2)
            EndIf
        EndIf
        ToolTip("     Casting")
        Sleep($baitdelay)
        If WinActive($windowname) <> 1 Then WinActivate($windowname)
        ControlSend($windowname, "", "", $fishkey)
        ToolTip("     Fishing")
        Sleep($castdelay)
        While 1
            Sleep($fishdelay)
            If WinActive($windowname) <> 1 Then WinActivate($windowname)
            $pullrod = PixelSearch($fleft, $ftop, $fright, $fbottom, $fishcol, $fcoldif)
            ;$pullrod = PixelSearch(390, 242, 395, 247, $fishcol, $fcoldif)
            If $pullrod <> 1 Then
                ToolTip("     Catching Fish")
                Sleep(100)
                ControlSend($windowname, "", "", $fishkey)
                Sleep($pulldelay)
                ExitLoop
            EndIf
        WEnd
    WEnd
EndFunc
Func Terminate()
    Exit
EndFunc
Func LoadIni()
    ;Color
        $MonsterTextCol = IniRead(@ScriptDir & "\Metin.ini", "Color", "MonsterText", "")
        $fishcol = IniRead(@ScriptDir & "\Metin.ini", "Color", "Fishing", "")
        $fcoldif = IniRead(@ScriptDir & "\Metin.ini", "Color", "FishColorDifference", "")
    ;Delays
        $mainsleep = IniRead(@ScriptDir & "\Metin.ini", "Delays", "MainSleep", "") 
        $serverdelay = IniRead(@ScriptDir & "\Metin.ini", "Delays", "Server", "")
        $runsleep = IniRead(@ScriptDir & "\Metin.ini", "Delays", "Run", "")
        $fishdelay = IniRead(@ScriptDir & "\Metin.ini", "Delays", "Fish", "")
        $pulldelay = IniRead(@ScriptDir & "\Metin.ini", "Delays", "RodPull", "")
        $castdelay = IniRead(@ScriptDir & "\Metin.ini", "Delays", "RodCast", "")
        $baitdelay = IniRead(@ScriptDir & "\Metin.ini", "Delays", "Bait", "")
        $fixscreen = IniRead(@ScriptDir & "\Metin.ini", "Delays", "FixScreen", "")
        $switchwindow = IniRead(@ScriptDir & "\Metin.ini", "Delays", "SwitchWindow", "")
    ;Keys
        $usehokeys = IniRead(@ScriptDir & "\Metin.ini", "Other", "UseHotkeys", "")
        $endkey = IniRead(@ScriptDir & "\Metin.ini", "Keys", "ExitKey", "")
        $startkey = IniRead(@ScriptDir & "\Metin.ini", "Keys", "StartKey", "")
        $pausekey = IniRead(@ScriptDir & "\Metin.ini", "Keys", "PauseKey", "")
        $runkey = IniRead(@ScriptDir & "\Metin.ini", "Keys", "RunKey", "")
        $startfishkey = IniRead(@ScriptDir & "\Metin.ini", "Keys", "StartFishingKey", "")
        $fishkey = IniRead(@ScriptDir & "\Metin.ini", "Keys", "FishingKey", "")
        $baitkey1 = IniRead(@ScriptDir & "\Metin.ini", "Keys", "BaitKey1", "")
        $baitkey2 = IniRead(@ScriptDir & "\Metin.ini", "Keys", "BaitKey2", "")
        If $usehokeys = 1 Then
            HotKeySet($endkey, "Terminate")
            HotKeySet($PauseKey,"Pause")
            ;HotKeySet($startkey, "OpenAndLogin")
            HotKeySet($runkey, "_run")
            HotKeySet($startfishkey, "Fishing")
        EndIf
    ;Other
        $login = IniRead(@ScriptDir & "\Metin.ini", "Other", "Login", "")
        $password = IniRead(@ScriptDir & "\Metin.ini", "Other", "Password", "")
        $gamedir = IniRead(@ScriptDir & "\Metin.ini", "Other", "GameDir", "")
        $gamename = IniRead(@ScriptDir & "\Metin.ini", "Other", "GameExeName", "")
        $windowname = IniRead(@ScriptDir & "\Metin.ini", "Other", "WindowName", "METIN2")
        $usesounds = IniRead(@ScriptDir & "\Metin.ini", "Other", "UseSounds","")
    ;Opt
        ;Delays
            $sk = IniRead(@ScriptDir & "\Metin.ini", "Opt", "SendKeyDelay", "")
            $skd = IniRead(@ScriptDir & "\Metin.ini", "Opt", "SendKeyDownDelay", "")
            $mc = IniRead(@ScriptDir & "\Metin.ini", "Opt", "MouseClickDelay", "")
            $mcdown = IniRead(@ScriptDir & "\Metin.ini", "Opt", "MouseClickDownDelay", "")
            $msdrag = IniRead(@ScriptDir & "\Metin.ini", "Opt", "MouseClickDragDelay", "")
        ;Modes
            $pc = IniRead(@ScriptDir & "\Metin.ini", "Opt", "PixelCoordMode", "")
            $wtextm = IniRead(@ScriptDir & "\Metin.ini", "Opt", "WinTextMatchMode", "")
            $wtitlem = IniRead(@ScriptDir & "\Metin.ini", "Opt", "WinTitleMatchMode", "")
            $mc = IniRead(@ScriptDir & "\Metin.ini", "Opt", "MouseCoordMode", "")
            $cc = IniRead(@ScriptDir & "\Metin.ini", "Opt", "CaretCoordMode", "")
            $cm = IniRead(@ScriptDir & "\Metin.ini", "Opt", "ColorMode", "")
        ;Other
            $wsc = IniRead(@ScriptDir & "\Metin.ini", "Opt", "WinSearchChildren", "")
    ;Coords
        ;Select Server
            $server = IniRead(@ScriptDir & "\Metin.ini", "Other", "WhatServer", "")
            $windowx = IniRead(@ScriptDir & "\Metin.ini", "Coords", "WindowX", "")
            $windowy =  IniRead(@ScriptDir & "\Metin.ini", "Coords", "WindowY", "")
            $Servokx = IniRead(@ScriptDir & "\Metin.ini", "Coords", "ServerOkButtonX", "")
            $Servoky = IniRead(@ScriptDir & "\Metin.ini", "Coords", "ServerOkButtonY", "")
            If $server = 1 Then
                $serverx = IniRead(@ScriptDir & "\Metin.ini", "Coords", "Server1X", "")
                $servery = IniRead(@ScriptDir & "\Metin.ini", "Coords", "Server1Y", "")
            ElseIf $server = 2 then
                $serverx = IniRead(@ScriptDir & "\Metin.ini", "Coords", "Server2X", "")
                $servery = IniRead(@ScriptDir & "\Metin.ini", "Coords", "Server2Y", "")
            EndIf
            $connectx = IniRead(@ScriptDir & "\Metin.ini", "Coords", "ConnectButtonX", "")
            $connecty = IniRead(@ScriptDir & "\Metin.ini", "Coords", "ConnectButtonY", "")
        ;Fishing
            $fleft = IniRead(@ScriptDir & "\Metin.ini", "Coords", "FishLeft", "")
            $ftop = IniRead(@ScriptDir & "\Metin.ini", "Coords", "FishTop", "")
            $fright = IniRead(@ScriptDir & "\Metin.ini", "Coords", "FishRight", "")
            $fbottom = IniRead(@ScriptDir & "\Metin.ini", "Coords", "FishBottom", "")
EndFunc
Func _Opt()
    ;Delays 
        Opt("SendKeyDelay", $sk)
        Opt("SendKeyDownDelay", $skd)
        Opt("MouseClickDelay", $mc)
        Opt("MouseClickDownDelay", $mcdown)
        Opt("MouseClickDragDelay", $msdrag)
    ;Modes
        Opt("PixelCoordMode", $pc)
        Opt("WinTextMatchMode", $wtextm)
        Opt("WinTitleMatchMode", $wtitlem)
        Opt("MouseCoordMode", $mc)
        Opt("CaretCoordMode", $cc)
        Opt("ColorMode", $cm)
    ;Other
        Opt("WinSearchChildren", $wsc)
EndFunc
Func _run()
    While 1
        If _IsPressed("57") Then ;57 = w
            While 1
                Send("{w down}")
                Sleep($runsleep)
                If _IsPressed("57") Then
                    If $usesounds = 1 Then Beep(500, 10)
                    Send("{w down}")
                    send("")
                    ExitLoop
                EndIf   
            WEnd
        ElseIf _IsPressed("53") Then ;53 = s
            While 1
                Send("{s down}")
                Sleep($runsleep)
                If _IsPressed("53") Then
                    If $usesounds = 1 Then Beep(500, 10)
                    Send("{s down}")
                    send("")
                    ExitLoop
                EndIf   
            WEnd
        ElseIf _IsPressed("41") Then ;41 = a
            While 1
                Send("{a down}")
                Sleep($runsleep)
                If _IsPressed("41") Then
                    If $usesounds = 1 Then Beep(500, 10)
                    Send("{a down}")
                    send("")
                    ExitLoop
                EndIf   
            WEnd
        ElseIf _IsPressed("44") Then ;44 = d
            While 1
                Send("{d down}")
                Sleep($runsleep)
                If _IsPressed("44") Then
                    If $usesounds = 1 Then Beep(500, 10)
                    Send("{d down}")
                    send("")
                    ExitLoop
                EndIf   
            WEnd
        EndIf
        Sleep($mainsleep)
    WEnd
EndFuncoÝ÷ Ú)âjëh×6[Color]
MonsterText = 0xEB1609
Fishing = 0xF4F0F4
FishColorDifference = 5

[Keys]
***************************************************************************************************
***                                                                                             ***
***         ! is equal to ALT               IE: !d  will send ALT + d                           ***
***         + is equal to SHIFT             IE: +!d will send SHIFT + ALT + d                   ***
***         ^ is equal to CTRL                                                                  ***
***                                                                                             ***
***************************************************************************************************
ExitKey = {ESC}
StartKey = {HOME}
PauseKey = {INS}
RunKey = {DEL}
StartFishingKey = {PGUP}
FishingKey = {F1}
BaitKey1 = {F3}
BaitKey2 = {F4}

[Other]
Login = 
Password = 
WhatServer = 1
UseHotkeys = 1
GameDir = C:\Program Files\Metin2
GameExeName = metin2.exe
WindowName = METIN2
UseSounds = 0

[Delays]
MainSleep = 1000
Server = 2000
Run = 1000
Fish = 500
RodPull= 8000
RodCast = 3000
Bait = 5000
FixScreen = 9000
SwitchWindow =  100

[Opt]
***************************************************************************************************
***                     DO NOT EDIT IF YOU DO NOT KNOW WHAT YOU ARE DOING!                      ***
***************************************************************************************************
***                                                                                             ***
***         PixelCoordMode ------>  1=absolute, 0=relative, 2=client                            ***
***         WinTextMatchMode ---->  1=complete, 2=quick                                         ***
***         WinSearchChildren --->  0=no, 1=search children also                                ***
***         WinTitleMatchMode --->  1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase     ***
***         SendKeyDelay -------->  5 milliseconds                                              ***
***         SendKeyDownDelay ---->  1 millisecond                                               ***
***         MouseClickDelay ----->  10 milliseconds                                             ***
***         MouseClickDownDelay ->  10 milliseconds                                             ***
***         MouseClickDragDelay ->  250 milliseconds                                            ***
***         MouseCoordMode ------>  1=absolute, 0=relative, 2=client                            ***
***         CaretCoordMode ------>  1=absolute, 0=relative, 2=client                            ***
***         ColorMode ----------->  0=RRGGBB color, 1=BBGGRR color                              ***
***                                                                                             ***
***************************************************************************************************
PixelCoordMode = 2
WinTextMatchMode = 1
WinSearchChildren =  1
WinTitleMatchMode = 1
SendKeyDelay = 1
SendKeyDownDelay = 1
MouseClickDelay = 10
MouseClickDownDelay = 10
MouseClickDragDelay = 250
MouseCoordMode = 2
CaretCoordMode = 2
ColorMode = 0

[Coords]
WindowX = -1
WindowY = -22
ServerOkButtonX = 526
ServerOkButtonY = 493
Server1X = 520
Server1Y = 360
Server2X = 520
Server2Y = 380
ConnectButtonX = 585
ConnectButtonY = 524
FishTop = 242
FishRight = 395
FishLeft = 390
FishBottom = 247

Share this post


Link to post
Share on other sites
Golbez

anyone want to help me make a bot? :)

Share this post


Link to post
Share on other sites
bogQ

i had to get to lvl 20 to start fishing, and lvling in this game isnt easy so sry becose it tooked me some time to reply

i think i finded whats wrong with the send, the problems r makeing txtbox focus in the game itself, any info (guide txtbox, war declaration notice, mouse on item in your inventory 4 info on it, or others) is blocking send command to send it to the right place.

this is what i tryed on like 100 "Riceball (bait)", on windowmode, i did not tested it on fullscreen mode, it reseted the send on every 30 seconds +- 5 seconds if he dont finde target, so its working 4 me ^^

HotKeySet("{F10}", "gogogo")
HotKeySet("{F11}", "toexit")
HotKeySet("{F9}", "error")

Global $set_error = 0
Global $i_hate_fishing = 0
If Not WinActive("xxxxxx") Then WinActivate("xxxxxx") ;<== i did not put the windowname becose i dont whant that someone searching on google see this ^^, reedit it in your script when you try

Sleep(5000)
Send("{F2}")
Sleep(5000)
Send("{F1}")
gogogo()

Func gogogo()
    While 1
        Sleep(50) ;<== ok so time is 50
        $pullrod = PixelSearch(620, 420, 677, 437, "0xF4F0F4", 5) ;<== i set coordinates 4 my box becose i play on difrent resolytion, reedit it in your script when you try
        $i_hate_fishing = $i_hate_fishing + 50 ;<and i add it (50) so that i can reset it with time
        ;$pullrod = PixelSearch(390, 242, 395, 247, $fishcol, $fcoldif)
        If $pullrod <> 1 Then
            Send("{F1}")
            Sleep(10000)
            Send("{F2}")
            Sleep(5000)
            Send("{F1}")
            $i_hate_fishing = 0
        EndIf
        If $i_hate_fishing = 30000 Then ;<== so when he dont finde target in more then 30 sec he will send one more time commands and reset curcle of fishing
            ToolTip($set_error)
            Sleep(5000)
            ToolTip("")
            Sleep(5000)
            Send("{F2}")
            Sleep(5000)
            Send("{F1}")
            $set_error = $set_error + 1 ;<== so how many errors i had
            $i_hate_fishing = 0
        EndIf
    WEnd
EndFunc

Func toexit()
    MsgBox(0,"","i have "&$set_error&" errors")
    Exit
EndFunc

and i hope that this will work 4 y.

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
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.

 

Share this post


Link to post
Share on other sites
Golbez

ty.. ill be testing soon..

btw how do you like the game :)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×