|
You last visited: Today at 19:38
Advertisement
Tratsch rund um Autoit / Autoit Talk | kleinere Fragen
Discussion on Tratsch rund um Autoit / Autoit Talk | kleinere Fragen within the AutoIt forum part of the Coders Den category.
09/14/2014, 19:29
|
#2086
|
elite*gold: 0
Join Date: Sep 2013
Posts: 1,927
Received Thanks: 201
|
Quote:
Originally Posted by »FlutterShy™
doch du machst es aber falsch.
ich hab immer _IeCreateEmbedded benutzt und dann das fenster je nach wunsch eingebunden oder halt nicht.
zum beispiel zum debuggen. Trägt der die daten überhaupt ein? klickt er den login button?
|
gerade gelöscht, weil ich eine lösung gefunden habe :O
|
|
|
09/17/2014, 19:13
|
#2087
|
elite*gold: 138
Join Date: Apr 2012
Posts: 3,494
Received Thanks: 1,769
|
Hey, könnte mal jemand (mit viel Erfahrung in AutoIt) einen Blick auf mein Bot werfen? Die Botuser beschweren sich dauernd über diesen "Maximum stack overflow reached - AutoIt will quit to prevent spam attacks" Error. Außerdem ist mein Code sicher verbesserungswürdig und da hier welche sind die sich richtig auskennen, würde es mich freuen, wenn ihr mir ein paar Tipps geben könntet. Der Code ist 650 Zeilen lang wobei aber fast die hälfte nur GUI Zeug ist. Bitte bei Interesse melden oder hier schreiben
|
|
|
09/17/2014, 19:36
|
#2088
|
elite*gold: 50
Join Date: Sep 2012
Posts: 3,841
Received Thanks: 1,462
|
schick mir das script
|
|
|
09/18/2014, 09:58
|
#2089
|
elite*gold: 0
Join Date: Mar 2009
Posts: 7,260
Received Thanks: 33,149
|
Das wird wahrscheinlich an rekursiven Funktionsaufrufen liegen.
|
|
|
09/18/2014, 13:47
|
#2090
|
elite*gold: 50
Join Date: Sep 2012
Posts: 3,841
Received Thanks: 1,462
|
Quote:
Originally Posted by KDeluxe
Das wird wahrscheinlich an rekursiven Funktionsaufrufen liegen.
|
ja. ich erklär ihm das schon.
er hat auch unendlich viele while schleifen ineinander
|
|
|
09/18/2014, 14:02
|
#2091
|
elite*gold: 0
Join Date: Mar 2009
Posts: 7,260
Received Thanks: 33,149
|
Das ist, anders als die rekursiven Funktionsaufrufe, aber nicht weiter schlimm. Eine While-Schleife ist ja nicht gleich eine Endlosschleife. Falls noch bedarf besteht kann ich mir den Code auch noch einmal angucken.
|
|
|
09/18/2014, 17:21
|
#2092
|
elite*gold: 50
Join Date: Sep 2012
Posts: 3,841
Received Thanks: 1,462
|
Quote:
Originally Posted by KDeluxe
Das ist, anders als die rekursiven Funktionsaufrufe, aber nicht weiter schlimm. Eine While-Schleife ist ja nicht gleich eine Endlosschleife. Falls noch bedarf besteht kann ich mir den Code auch noch einmal angucken.
|
ich wollte mit ihm in skype den code mal überarbeiten da er wirklich noch keine ahnung hat wie man strukturiert code schreibt.
Bei ihm endet das in:
Code:
_LOL
Func _LOL()
While 1
If bla Then _LOL()
WEnd
EndFunc
dann wollte ich den code noch optimieren und ein paar fehler ausbessern.
Eventuell noch auf die FastFind.dll umsteigen damit das ganze langsame pixelsearch zeug verschwindet
|
|
|
09/18/2014, 19:14
|
#2093
|
elite*gold: 138
Join Date: Apr 2012
Posts: 3,494
Received Thanks: 1,769
|
Naja PixelSearch ist doch sowieso schnell, vorallem wenn der abzusuchende Bereich nur 800x600 groß ist. Wenn ihr ein Anfänger Script sehen wollt dann nur zu ^^
(Copy & Paste in AutoIt Editor)
|
|
|
09/20/2014, 11:01
|
#2094
|
elite*gold: 0
Join Date: Mar 2009
Posts: 7,260
Received Thanks: 33,149
|
Ist das das richtige Script? Es beinhaltet viele Fehler, ausführen kann man es gar nicht. So kann es natürlich auch nicht zu einem Stack Overflow kommen.
|
|
|
09/21/2014, 15:08
|
#2095
|
elite*gold: 138
Join Date: Apr 2012
Posts: 3,494
Received Thanks: 1,769
|
Quote:
Originally Posted by KDeluxe
Ist das das richtige Script? Es beinhaltet viele Fehler, ausführen kann man es gar nicht. So kann es natürlich auch nicht zu einem Stack Overflow kommen.
|
Ja das ist das richtige Script. Ich weiß dass es nicht fehlerfrei ist  Aber wieso sollte man es nicht ausführen können?
|
|
|
09/21/2014, 21:42
|
#2096
|
elite*gold: 0
Join Date: Mar 2009
Posts: 7,260
Received Thanks: 33,149
|
Es fehlen viele Rechenoperationen und Klammern (→ Syntaxfehler). Poste das funktionierende Script doch noch einmal hier in einem Code-Tag.
|
|
|
09/23/2014, 09:39
|
#2097
|
elite*gold: 138
Join Date: Apr 2012
Posts: 3,494
Received Thanks: 1,769
|
Ja das hat mir FlutterShy auch gesagt. Das ist n Fehler von dieser Copy&Paste Seite. Kp warum das nicht eingefügt wurde.
Code:
HotKeySet("{F3}","beenden")
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <StaticConstants.au3>
#include <GuiEdit.au3>
#include <ScrollBarsConstants.au3>
#include <Timers.au3>
#include <WinHttp.au3>
#include <Array.au3>
#include <Misc.au3>
Global $Server = ""
Global $Pearls = 0
Global $Gold = 0
Global $Mojos = 0
Global $Cookies[0]
Global $PearlsNew = 0
Global $ManuelMinimap = 0
Global $ManuelSeaChart = 0
Global $Done = 0
Global $UserLogin
Global $MaybeSeaChart
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Login", 275, 125,@DesktopWidth / 2 - 150, @DesktopHeight / 2 - 100)
$username = GUICtrlCreateLabel("Username:", 24, 24, 55, 17)
$password = GUICtrlCreateLabel("Password:", 24, 56, 53, 17)
$inputusername = GUICtrlCreateInput("", 80, 16, 97, 21)
$inputpassword = GUICtrlCreateInput("", 80, 48, 97, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD))
$Login = GUICtrlCreateButton("Login", 192, 14, 65, 25)
GuiCtrlSetState(-1, 512)
$Skip = GUICtrlCreateButton("Skip", 192, 45, 65, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Login
$usernameinput = GUICtrlRead($inputusername)
$passwordinput = GUICtrlRead($inputpassword)
$LabelLoggingin = GUICtrlCreateLabel("Logging in...", 80, 88, 62, 17)
$bLogin = Login($usernameinput,$passwordinput)
IF $bLogin = True Then
GetInformations()
Global $UserLogin = True
GUIDelete()
ExitLoop
Else
MsgBox(0,"Login Error!","Username / Password wrong!")
GUICtrlSetData($LabelLoggingin,"")
EndIf
Case $Skip
MsgBox(0,"","Some features won't work without Login")
Global $UserLogin = False
GUIDelete()
ExitLoop
EndSwitch
WEnd
#Region ### START Koda GUI section ### Form=c:\users\tronics\desktop\epvp\koda\forms\mshiny13.kxf
$Form1_1 = GUICreate("MShiny", 199, 264, 231, 124)
$Label1 = GUICtrlCreateLabel("MShinyBot 1.6", 24, 16, 151, 27)
GUICtrlSetFont(-1, 15, 400, 0, "Cooper Black")
GUICtrlSetColor(-1, 0x0000FF)
$Label2 = GUICtrlCreateLabel("with Costum Client", 56, 40, 117, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Cooper Black")
$Label3 = GUICtrlCreateLabel("Repair Key must be 'R'", 40, 136, 133, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Label4 = GUICtrlCreateLabel("Set course must be 'C'", 40, 160, 131, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Label5 = GUICtrlCreateLabel("30% Zoom", 64, 88, 62, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Label6 = GUICtrlCreateLabel("800x600", 72, 112, 52, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Button1 = GUICtrlCreateButton("Start", 16, 200, 73, 25)
$Button2 = GUICtrlCreateButton("Test", 104, 200, 73, 25)
$Button3 = GUICtrlCreateButton("Problems? Define Manuelly", 16, 232, 161, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $Button3
GUISetState(@SW_MINIMIZE,$Form1_1)
TrayTip("Manual Define","Go to the top left corner of your SEACHART and press F2",15)
While 1
If _IsPressed(71) Then
$mPosMan = MouseGetPos()
$DefineSeaChart = PixelSearch($mPosMan[0]-50,$mPosMan[1]-50,$mPosMan[0]+50,$mPosMan[1]+50,0x00253B)
If not @error Then
Global $SeaChartX = $DefineSeaChart[0]
Global $SeaChartY = $DefineSeaChart[1]
Global $ManuelSeaChart = 1
Else
MsgBox(0,"","SeaChart not found")
ExitLoop
EndIf
Global $MaybeSeaChart = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,0x808080)
If IsArray($MaybeSeaChart) Then
BetterSeaChartTest()
EndIf
MsgBox(0,"","SeaChart manually defined from " & $SeaChartX & ":" & $SeaChartY & " to " & $SeaChartX+780 & ":" & $SeaChartY+580)
TrayTip("Manual Define","Go to the top left corner of your MINIMAP and press F2",15)
While 1
If _IsPressed(71) Then
$mPosMan2 = MouseGetPos()
$DefineMinimap = PixelSearch($mPosMan2[0]-30,$mPosMan2[1]-30,$mPosMan2[0]+30,$mPosMan2[1]+30,0x185A82)
If not @error Then
Global $MinimapLeft = $DefineMinimap[0]
Global $MinimapTop = $DefineMinimap[1]
Global $ManuelMinimap = 1
Else
MsgBox(0,"","SeaChart not found")
ExitLoop
EndIf
MsgBox(0,"","Minimap manually defined from " & $MinimapLeft & ":" & $MinimapTop & " to " & $MinimapLeft+95 & ":" & $MinimapTop+95)
Global $Done = 1
GUISetState(@SW_RESTORE,$Form1_1)
ExitLoop
EndIf
WEnd
EndIf
If $Done = 1 Then
ExitLoop
EndIf
WEnd
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
GUIDelete()
Global $AmountGlitter = 1
;Log
$FormLog = GUICreate("Log", 154, 177, 5,@DesktopHeight / 2 -100)
GUISetBkColor(0xE3E3E3)
$StatusLabel = GUICtrlCreateLabel("Status", 8, 8, 40, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Status = GUICtrlCreateLabel("Starting...", 8, 24, 136, 23)
GUICtrlSetFont(-1, 12, 800, 0, "Century Gothic")
$PearlsLabel = GUICtrlCreateLabel("Pearls:", 8, 88, 43, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x0000FF)
$MojosLabel = GUICtrlCreateLabel("Mojos:", 8, 112, 41, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x008000)
$Glitters0 = GUICtrlCreateLabel($AmountGlitter - 1, 56, 64, 40, 17)
$Pearls0 = GUICtrlCreateLabel("0", 56, 88, 40, 17)
$LabelTime = GUICtrlCreateLabel("0:0:0", 85, 146, 57, 23)
GUICtrlSetFont(-1, 12, 800, 0, "Century Gothic")
$ExitLabel = GUICtrlCreateLabel("[F3} Exit", 8, 150, 52, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$GlittersLabel = GUICtrlCreateLabel("Glitters:", 8, 64, 48, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Mojos0 = GUICtrlCreateLabel("0", 56, 112, 40, 17)
GUISetState(@SW_SHOW)
WinSetOnTop($FormLog,"",1)
;EndLog
Global $timer2 = TimerInit()
$TimerLog = TimerInit()
_Timer_SetTimer($FormLog, 1000, "_UpdateTimer")
Sleep(500)
AutoDefinition()
Case $Button2
GUISetState(@SW_MINIMIZE,$Form1_1)
Sleep(500)
AutoDefinitionTest()
If $SeaChartTrue = 1 And $MinimapTrue = 1 Then
MsgBox(0,"","Minimap found at: " & $MinimapLeft & ":" & $MinimapTop & " to " & $MinimapLeft + 95 & ":" & $MinimapTop+95 & @crlf & "SeaChart found at: " & $SeaChartX & ":" & $SeaChartY & " to " & $SeaChartX + 780 & ":" & $SeaChartY + 580)
EndIf
WinSetState ( "MShiny", "", @SW_RESTORE )
EndSwitch
WEnd
Func checkIfGlitterView()
$GlitterView = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,0x1C9E1C)
If not @error Then
MouseClick("left",$GlitterView[0]+15,$GlitterView[1]+15,1,2)
main()
Else
main()
EndIf
EndFunc
Func main()
While 1 ;random Minimap point
Sleep(200)
MouseClick("left",$MinimapLeft + Random(5,80),$MinimapTop + Random(5,80),1,2)
Sleep(700)
$mPos = MouseGetPos()
$Color = PixelGetColor($mPos[0],$mPos[1])
If $mPos[0] > $IslandLeft AND $mPos[0] < $IslandRight AND $mPos[1] > $IslandTop AND $mPos[1] < $IslandBottom Then
ElseIf $Color = 1596034 Then
Global $timerGlitterNew = TimerInit()
GUICtrlSetData($Status,"Looking for Glitter")
Sleep(400)
Send("c")
Global $mPosGreen = MouseGetPos()
Suchen()
EndIf
CheckShipRepair()
WEnd
EndFunc
Func testMonster()
$mPos10 = MouseGetPos()
$PC = PixelGetColor($mPos10[0],$mPos10[1])
If $PC = 12040119 Then
MouseMove($mPos10[0],$mPos10[1]+1)
testMonster()
EndIf
#cs
Sleep(500)
MouseClick("left",$MinimapLeft + Random(5,80),$MinimapTop + Random(5,80),1,2)
$mPos = MouseGetPos()
$Color = PixelGetColor($mPos[0],$mPos[1])
If $Color = 1596034 Then
Send("c")
Sleep(10000)
main()
Else
testMonster()
EndIf
CheckShipRepair()
#ce
EndFunc
Func Suchen()
While 1
$GreenPoint = PixelSearch($mPosGreen[0]-5,$mPosGreen[1]-5,$mPosGreen[0]+5,$mPosGreen[1]+5,0x00FF00)
If not @error Then
main()
EndIf
$TimerDiffGreen = TimerDiff($timerGlitterNew)
If $TimerDiffGreen > 30000 Then
main()
EndIf
; $TooCloseIsland = PixelSearch($IslandLeft,$IslandTop,$IslandRight,$IslandBottom,0x00FF00)
; If not @error Then
; $DiffX = $island[0] - $TooCloseIsland[0]
; $DiffY = $island[1] - $TooCloseIsland[1]
; MouseClick("left",($island[0] + $DiffX) * 2,($island[1] + $DiffY) * 2,1,2)
; EndIf
$GlitterOnMinimap = PixelSearch($MinimapLeft,$MinimapTop,$MinimapLeft + 95,$MinimapTop + 95,0xFCF900,25)
If not @error Then
GUICtrlSetData($Status,"Glitter Found")
MouseClick("left",$GlitterOnMinimap[0],$GlitterOnMinimap[1],1,2)
$mPos3 = MouseGetPos()
Global $Color2 = PixelGetColor($mPos3[0],$mPos3[1])
Sleep(2000)
realizeGlitter()
ExitLoop
EndIf
CheckShipRepair()
WEnd
EndFunc
Func realizeGlitter()
CheckShipRepair()
$GlitterOnSea = PixelSearch($SeaChartX,$SeaChartY,$SeaChartX+780,$SeaChartY+580,0x000000)
If not @error and $GlitterOnSea[0] > $SeaChartX-3 and $GlitterOnSea[0] < $SeaChartX+777 and $GlitterOnSea[1] > $SeaChartY-3 and $GlitterOnSea[1] < $SeaChartY+577 Then
GUICtrlSetData($Status,"Collecting Glitter")
MouseClick("left",$GlitterOnSea[0]+3,$GlitterOnSea[1]+3,1,2)
Sleep(1000)
CheckShipRepair()
Global $TimerInit23 = TimerInit()
WaitUntilGlitterCollected()
EndIf
$KrakenOnSea = PixelSearch($SeaChartX,$SeaChartY,$SeaChartX+780,$SeaChartY+580,0x18FFFF)
If not @error and $GlitterOnSea[0] > $SeaChartX-3 and $GlitterOnSea[0] < $SeaChartX+777 and $GlitterOnSea[1] > $SeaChartY-3 and $GlitterOnSea[1] < $SeaChartY+577 Then
MouseClick("left",$KrakenOnSea[0]+3,$KrakenOnSea[1]+3,1,2)
GUICtrlSetData($Status,"Collecting Meat")
Sleep(1000)
CheckShipRepair()
Global $TimerInit23 = TimerInit()
WaitUntilGlitterCollected()
EndIf
EndFunc
Func beenden()
MsgBox(0,"Exit","Thanks for using MShiny")
Exit
EndFunc
Func WaitUntilGlitterCollected()
CheckShipRepair()
$TimerDiff23 = TimerDiff($TimerInit23)
If $TimerDiff23 > 25000 Then
main()
EndIf
$mPos4 = MouseGetPos()
$PixelColor = PixelGetColor($mPos4[0],$mPos4[1])
If $PixelColor = 12040119 Then
testMonster()
EndIf
If $PixelColor = 0 Then
Sleep(500)
MouseClick("left")
Sleep(1000)
WaitUntilGlitterCollected()
Else
$AmountGlitter = $AmountGlitter + 1
GUICtrlSetData($Glitters0, $AmountGlitter - 1)
IF $UserLogin = True Then
GetInformationsNew()
GUICtrlSetData($Pearls0, $PearlsNew - $Pearls)
GUICtrlSetData($Mojos0, $MojosNew - $Mojos)
EndIf
realizeGlitter()
EndIf
EndFunc
Func AutoDefinition()
If $ManuelMinimap = 0 Then
$DefineMinimap = PixelSearch(70,70,@DesktopWidth-70,@DesktopHeight-70,0x185A82,0)
If not @error Then
Global $MinimapLeft = $DefineMinimap[0]
Global $MinimapTop = $DefineMinimap[1]
Else
MsgBox(0,"Error!","Minimap not found")
Exit
EndIf
EndIf
checkIsland()
If $ManuelSeaChart = 0 Then
Global $DefineSeaChart = PixelSearch(70,70,@DesktopWidth-70,@DesktopHeight-70,0x00253B)
If not @error Then
Global $SeaChartX = $DefineSeaChart[0]
Global $SeaChartY = $DefineSeaChart[1]
Else
MsgBox(0,"Error!","Minimap not found")
EndIf
Global $MaybeSeaChart = PixelSearch(70,70,@DesktopWidth-70,@DesktopHeight-70,0x808080)
If not @error Then
BetterSeaChart()
EndIf
EndIf
checkIfGlitterView()
EndFunc
Func BetterSeaChart()
If $DefineSeaChart[0] > $MaybeSeaChart[0] Then
Global $SeaChartX = $MaybeSeaChart[0]
Global $SeaChartY = $MaybeSeaChart[1]
EndIf
checkIfGlitterView()
EndFunc
Func checkIsland()
Global $island = PixelSearch($MinimapLeft,$MinimapTop,$MinimapLeft + 95, $MinimapTop + 95,0xBC7A7A)
If not @error Then
Global $IslandLeft = $island[0] - 10
Global $IslandTop = $island[1] - 10
Global $IslandRight = $IslandLeft + 20
Global $IslandBottom = $islandTop +20
Else
Global $IslandLeft = @DesktopWidth
Global $IslandTop = @DesktopHeight
Global $IslandRight = 0
Global $IslandBottom = 0
EndIf
EndFunc
Func CheckShipRepair()
$ShipRepair = PixelSearch($SeaChartX,$SeaChartY,$SeaChartX+780,$SeaChartY+580,0x665A38)
If not @error Then
Sleep(2000)
GUICtrlSetData($Status,"Repairing")
MouseMove($ShipRepair[0]+30,$ShipRepair[1]+30,10)
MouseClick("left")
Sleep(5000)
Send("r")
Global $RepairTimer = TimerInit
RepairMode()
EndIf
EndFunc
;I'm a comment :D
Func RepairMode()
While 1
$TimerDiffRepair = TimerDiff($RepairTimer)
If $TimerDiffRepair > 280000 Then
main()
ExitLoop
EndIf
$ShipRepair2 = PixelSearch($SeaChartX,$SeaChartY,$SeaChartX+780,$SeaChartY+580,0x665A38)
If not @error Then
MouseMove($ShipRepair2[0]+30,$ShipRepair2[1]+30,10)
MouseClick("left")
$RepairTimer = TimerInit()
Sleep(3000)
Else
Sleep(5100)
EndIf
WEnd
EndFunc
Func GetInformations()
$requestLink = "http://" & $Server & ".seafight.bigpoint.com/api/client/handleCauldron.php?&do=initCauldron&gameapi_consoledisable=1"
$cauldronSrc = HttpGet($requestLink)
$Mojos = Int(StrBetween($cauldronSrc,"<mojo>","</mojo>"))
$Pearls = Int(StrBetween($cauldronSrc,"<pearls>","</pearls>"))
EndFunc
Func GetInformationsNew()
$requestLink = "http://" & $Server & ".seafight.bigpoint.com/api/client/handleCauldron.php?&do=initCauldron&gameapi_consoledisable=1"
$cauldronSrc = HttpGet($requestLink)
Global $MojosNew = Int(StrBetween($cauldronSrc,"<mojo>","</mojo>"))
Global $PearlsNew = Int(StrBetween($cauldronSrc,"<pearls>","</pearls>"))
EndFunc
Func GetServer($homeSrc)
Return StrBetween($homeSrc,"<link rel=""meta"" href=""http://",".seafight.bigpoint.com")
EndFunc
Func Login($Username,$Password)
IF $Username = "" Or $Password = "" Then
Return False
Else
$sHome = HttpGet("http://www.seafight.bigpoint.com/");
$sLoginLink = StrBetween($sHome,"<form name=""bgcdw_login_form"" method=""post"" class=""bgcdw_login_form"" action=""",""">")
$sLoginLink = StringReplace($sLoginLink,"https","http")
$sLoginLink = StringReplace($sLoginLink,"&","&")
$sLoginResult = HttpPost($sLoginLink,"username=" & UrlEncode($Username) & "&password=" & UrlEncode($Password))
$Server = GetServer($sLoginResult)
$iResult = StringInStr($sLoginResult,"displayGold")
IF Not $iResult = 0 Then
GetInformations()
Return True
Else
Return False
EndIf
EndIf
EndFunc
Func StrBetween($input,$start,$end)
$startIndex = StringInStr($input,$start) + StringLen($start)
$endIndex = StringInStr($input,$end,0,1,$startIndex + 1)
$stringSize = $endIndex - $startIndex
Return StringMid($input,$startIndex,$stringSize)
EndFunc
Func UrlEncode($url)
$encodedUrl = ""
For $i = 1 To StringLen($url)
$aCode = Asc(StringMid($url,$i,1))
Select
Case ($aCode >= 48 And $aCode <= 57) or ($aCode >= 65 And $aCode <= 90) Or ($aCode >= 97 And $aCode <= 122)
$encodedUrl = $encodedUrl & StringMid($url, $i, 1)
Case $aCode = 32
$encodedUrl = $encodedUrl & "+"
Case Else
$encodedUrl = $encodedUrl & "%" & Hex($aCode,2)
EndSelect
Next
Return $encodedUrl
EndFunc
Global Const $HTTP_STATUS_OK = 200
Func HttpPost($sURL, $sData = "")
Local $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
$oHTTP.Open("POST", $sURL, False)
If (@error) Then Return SetError(1, 0, 0)
$oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
$oHTTP.Send($sData)
$HeaderResponse = $oHTTP.GetAllResponseHeaders()
HandleCookies($HeaderResponse)
If (@error) Then Return SetError(2, 0, 0)
If ($oHTTP.Status <> $HTTP_STATUS_OK) Then Return SetError(3, 0, 0)
Return SetError(0, 0, $oHTTP.ResponseText)
EndFunc
Func HttpGet($sURL, $sData = "")
Local $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
$oHTTP.Open("GET", $sURL & "?" & $sData, False)
If (@error) Then Return SetError(1, 0, 0)
For $i = 1 To UBound($Cookies) - 1
$oHTTP.SetRequestHeader("Cookie", $Cookies[$i])
Next
$oHTTP.Send()
$HeaderResponse = $oHTTP.GetAllResponseHeaders()
HandleCookies($HeaderResponse)
If (@error) Then Return SetError(2, 0, 0)
If ($oHTTP.Status <> $HTTP_STATUS_OK) Then Return SetError(3, 0, 0)
Return SetError(0, 0, $oHTTP.ResponseText)
EndFunc
Func HandleCookies($Header)
$array = StringRegExp($Header,"(?<=Set-Cookie: )(.*?)\r",3)
For $i = 0 To UBound($array) - 1
_ArrayAdd($Cookies,$array[$i])
Next
EndFunc
;Anfang test ----------------------------------------------------------------------------------------------------------
Func AutoDefinitionTest()
$DefineMinimap = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,0x185A82,0)
If not @error Then
Global $MinimapLeft = $DefineMinimap[0]
Global $MinimapTop = $DefineMinimap[1]
Global $MiniMapTrue = 1
Else
Global $MiniMapTrue = 0
MsgBox(0,"Error!","Minimap not found")
EndIf
checkIslandTest()
Global $DefineSeaChart = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,0x00253B)
If not @error Then
Global $SeaChartX = $DefineSeaChart[0]
Global $SeaChartY = $DefineSeaChart[1]
Global $SeaChartTrue = 1
Else
MsgBox(0,"Error!","SeaChart not found")
Global $SeaChartTrue = 0
EndIf
Global $MaybeSeaChart = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,0x808080)
If not @error And $SeaChartTrue = 1 Then
BetterSeaChartTest()
EndIf
EndFunc
Func BetterSeaChartTest()
If $DefineSeaChart[0] > $MaybeSeaChart[0] Then
Global $SeaChartX = $MaybeSeaChart[0]
Global $SeaChartY = $MaybeSeaChart[1]
EndIf
EndFunc
Func checkIslandTest()
If $MiniMapTrue = 1 Then
Global $island = PixelSearch($MinimapLeft,$MinimapTop,$MinimapLeft + 95, $MinimapTop + 95,0xBC7A7A)
If not @error Then
Global $IslandLeft = $island[0] - 10
Global $IslandTop = $island[1] - 10
Global $IslandRight = $IslandLeft + 20
Global $IslandBottom = $islandTop +20
MsgBox(0,"Success","Island found at: " & $IslandLeft & ":" & $IslandTop & " to " & $IslandRight & ":" & $IslandBottom)
Else
MsgBox(0,"Error!","No Island found")
EndIf
Else
MsgBox(0,"Error!","No Island found")
EndIf
EndFunc
; Ende test-------------------------------------------------------------------------------------------------------
Func _UpdateTimer($hWnd, $Msg, $iIDTimer, $dwTime)
$SECONDS = TimerDiff($TimerLog) / 1000
$MINUTES = Round(Floor(Mod($SECONDS / 60, 60)))
$HOURS = Round(Floor($SECONDS / 3600))
$SECONDS = Round(Mod($SECONDS, 60))
If $LabelTime Then
#forceref $hwnd, $Msg, $iIDTimer, $dvTime
GUICtrlSetData($LabelTime, $HOURS & ":" & $MINUTES & ":" & $SECONDS)
EndIf
EndFunc
|
|
|
09/24/2014, 18:51
|
#2098
|
elite*gold: 0
Join Date: Sep 2013
Posts: 1,927
Received Thanks: 201
|
Kennt ihr eine gute Lösung um Proxys zusetzen(Acc Creator) ?
Httpsetproxy() funktioniert nicht :/
|
|
|
09/24/2014, 20:25
|
#2099
|
elite*gold: 50
Join Date: Sep 2012
Posts: 3,841
Received Thanks: 1,462
|
Quote:
Originally Posted by Cσre
Kennt ihr eine gute Lösung um Proxys zusetzen(Acc Creator) ?
Httpsetproxy() funktioniert nicht :/
|
schlecht : HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Internet Settings
Gut: Erstelle ein objekt der WinHTTP.dll
die methoden findest du alle bei MSDN unter .Net da VB Script die dll auch unterstützt
|
|
|
09/24/2014, 21:15
|
#2100
|
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
|
Das was FlutterShy meint ist der 2. + 3. Parameter der _WinHttpOpen Funktion in der WinHttp.au3 (musst du separat ziehen).
Code:
$hSession = _WinHttpOpen(Default, 3, "ip:port")
|
|
|
Similar Threads
|
[Sammelthread]Fragen zu Autoit wie man Hacks herstellt(Autoit) + Antworten
11/16/2011 - Metin2 - 0 Replies
Hallo Liebe Community,
Ich habe diesen Thread aufgemacht weil manche leute mit Autoit nicht mehr weiterkommen wie man Hack herstellt ,ich habe mit schon ein Multihack mit Autoit herstellt das war einfach .Da viele User nicht weiterkommen werden habe ich mich entschieden ein Thread aufzumachen mit Fragen und ich den dann Antworten kann und helfen kann!
------------------------------------------------- ---------------------------
Mein Multihack:...
|
All times are GMT +1. The time now is 19:38.
|
|