Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 10:44

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Requests - AutoIt only

Discussion on Requests - AutoIt only within the AutoIt forum part of the Coders Den category.

Reply
 
Old 08/18/2014, 08:08   #181
 
elite*gold: 0
Join Date: Nov 2011
Posts: 1
Received Thanks: 0
vorwort: ich kenn mich mit autoit quasi 0 aus , dennoch sind es die kleinen scripts die mir schon lange helfen
bin bestimmt schon 2h am googlen aber nichts trifft genau mein problem

wie es sein sollte : ich brauch nen (hoffentlich)kleines script das wenn ich eine taste drücke (in meinem fall jetzt F4) mir (gleichbleibende)buchstaben+AUFSTEIGENDE ZAHL schreibt
bsp:
wenn ich F4 drücke-> schreib "buchstaben1"
wenn ich F4 das nächste mal drücke-> schreib "buchstaben2"
wenn ich F4 das nächste mal drücke-> schreib "buchstaben3"
usw.

das ist was ich momentan nutze - wobei ich hier die zahlen immer selbst eintippen muss was mit der zeit mühsam wird

ich möchte mich hiermit schonmal im voraus bedanken
darkwolf81 is offline  
Old 08/18/2014, 08:53   #182

 
Moneypulation's Avatar
 
elite*gold: 138
Join Date: Apr 2012
Posts: 3,494
Received Thanks: 1,769
Quote:
Originally Posted by darkwolf81 View Post
vorwort: ich kenn mich mit autoit quasi 0 aus , dennoch sind es die kleinen scripts die mir schon lange helfen
bin bestimmt schon 2h am googlen aber nichts trifft genau mein problem

wie es sein sollte : ich brauch nen (hoffentlich)kleines script das wenn ich eine taste drücke (in meinem fall jetzt F4) mir (gleichbleibende)buchstaben+AUFSTEIGENDE ZAHL schreibt
bsp:
wenn ich F4 drücke-> schreib "buchstaben1"
wenn ich F4 das nächste mal drücke-> schreib "buchstaben2"
wenn ich F4 das nächste mal drücke-> schreib "buchstaben3"
usw.

das ist was ich momentan nutze - wobei ich hier die zahlen immer selbst eintippen muss was mit der zeit mühsam wird

ich möchte mich hiermit schonmal im voraus bedanken
Ist eigentlich ganz simpel^^

Code:
#include <Misc.au3>
$zahl = 1
While 1
   If _IsPressed(73) Then
	  Send("WasAuchImmerDuWillst" & $zahl)
	  $zahl = $zahl + 1
   EndIf
WEnd
Moneypulation is offline  
Old 08/23/2014, 23:10   #183
 
bs_destroyer's Avatar
 
elite*gold: 0
Join Date: Jan 2011
Posts: 64
Received Thanks: 10
Seafight bot

Hey leute ich bin gerade dabei einen Seafight bot zu schreiben der Monster schießt... Er fährt auch rum aber wenn er ein monster sieht ( in meinem Fall moby dick unterbricht er nicht das fahren... Ich werde den Code hier posten


Hey guys,

I´m about to write a seafight monstershoot bot and he drives allready but if he find the monster he don´t brake up the driving and go to shoot the monster he just keep driving and driving and driving...

I will poste the code
Code:
HotKeySet("{F4}", "_StartBot")
HotKeySet("{F5}", "_PauseBot")
HotKeySet("{F6}", "_EndeBot")

Global $Active = 0


While 1

  ;-----------------------------------------------------------------------------------------Variabelen--------------------------------------------------------

    ;Monster

  $trankus = PixelSearch (406, 180,1194, 790,0x00FC00,1)
  $serena = PixelSearch (406, 180,1194, 790,0x00F900,1)
  $orca = PixelSearch (406, 180,1194, 790,0x00F600,1)
  $mobydick = PixelSearch (406, 180,1194, 790,0x00ED00,1)

  ;conncetionlost

  $connectionlost = PixelSearch (406, 180,1194, 790,0x6C7754,5)

  ;sunken

  $sunken = PixelSearch (406, 180,1194, 790,0x665A38,5)

  ;attackbutton

  $attackbutton = PixelSearch (1375, 390,1375, 390,0xFF8009,15)

  ;monstersearch

  $monstersearch = MouseClick ("left",1293, 162) Send ("v {Space}") Sleep (84200) MouseClick ("left", 1376, 160) Send ("v {SPACE}") Sleep (84200) MouseClick ("left" ,1292, 159) Send ("v {SPACE}") sleep (84200) MouseClick ("left",1377, 246) Send ("v {SPACE}") Sleep (84200)
;Attackin is true
$attacking = PixelSearch (60, 214,60, 214,0x00CF00,5)

;killingmobbydick

	 $killingmobydick = if IsArray ($mobydick) Then MouseClick ("left", $mobydick [0],$mobydick [1]) Sleep (75) MouseClick ("left", $mobydick [0]+35 ,$mobydick [1]+35 ) Sleep (75)if IsArray ($attackbutton) Then Send ("f")Sleep (75) if IsArray ($attacking) Then sleep (20000)EndIf EndIf EndIf
;----------------------------------------------------------------------------------------------Variabeln end -----------------------------------------------------

;sunken

if IsArray ($sunken) then
	MouseClick ("left", $sunken [0],$sunken [1],1)
EndIf

;connetion lost

if IsArray ($connectionlost) Then
	MouseClick ("left", $connectionlost [0] , $connectionlost [1],1)
EndIf
Do
	$monstersearch
	Until $killingmobydick






  WEnd


  Func _StartBot()
	$Active = 1
EndFunc

Func _PauseBot()
	$Active = 0
EndFunc

Func _EndeBot()
   MsgBox (1,"bot status", "Bot is off",10)
	Exit
EndFunc
bs_destroyer is offline  
Old 08/24/2014, 10:24   #184
 
DeluxeDose's Avatar
 
elite*gold: 0
Join Date: Feb 2010
Posts: 270
Received Thanks: 912
Du bleibst in der Schleife Do.. Until hängen.
Dein Bot macht solang "$monstersearch" bis "$killingmobydick" erfüllt ist, "$killingmobydick" prüft aber (ich hätte nicht gedacht das man Variablen als Funktionen einsetzen kann, sieht skurril aus) ob $mobydick ein Array ist, was nur einmal am Anfang abgefragt wird. Somit ist $mobydick nie ein Array, weil es nicht nochmal $mobydick sucht.

Pack das lieber in separate Funktionen und lass die While Schleife durchlaufen

Pseudocode:
While True
$aMonster = _sucheMonster()
For $position in $aMonster => _klick_das_monster_an_und_bekaempfe_es()
_suche_weiter()
WEnd
DeluxeDose is offline  
Old 08/24/2014, 12:26   #185
 
YatoDev's Avatar
 
elite*gold: 50
Join Date: Sep 2012
Posts: 3,841
Received Thanks: 1,462
vielleicht liegt es auch am total schlechten code.
les dir nochmal tutorials durch
YatoDev is offline  
Old 08/24/2014, 12:52   #186

 
Moneypulation's Avatar
 
elite*gold: 138
Join Date: Apr 2012
Posts: 3,494
Received Thanks: 1,769
Ich hoffe du willst den Bot nicht veröffentlichen. Der mag vielleicht bei dir die richtigen Koordinaten anklicken, jedoch gibt es viele verschiedene Bildschirmauflösungen. Außerdem ist der Codestil auch fragwürdig
Moneypulation is offline  
Old 08/25/2014, 00:08   #187
 
bs_destroyer's Avatar
 
elite*gold: 0
Join Date: Jan 2011
Posts: 64
Received Thanks: 10
Hahaha ich bin halt noch am üben^^

Und nein der wäre erstmal nur für mich ^^

Mein Angriffsbot funktioniert aber bei den meisten xD
bs_destroyer is offline  
Old 09/02/2014, 08:31   #188
 
pady2211's Avatar
 
elite*gold: 0
Join Date: Feb 2011
Posts: 97
Received Thanks: 11
Hey hab ne frage undzwar bräuchte ich jemanden der mir helfen kann ich habe gestern ein script bekommen in welchem die Leertaste Permanent gesendet werden soll (Das ist Perfekt) und dabei wird noch F4 gedrückt jetzt ist mein problem das F4 zu langsam gesendet wir kann mir das jemand schneller stellen?
Script:
Global Const $hotkeyPause = "{PAUSE}", $hotkeyExit = "{ESC}", $keyToSend = "{F4}"
Global Const $timeSleep = 10, $timeKeyInterval = 2000 ; time in ms
Global $running = False
Global $timerKeyToSend, $countKeySent

HotKeySet($hotkeyPause, "_TogglePause")
HotKeySet($hotkeyExit, "_Exit")

While Sleep($timeSleep)
If $running Then
Send("{SPACE}")
If TimerDiff($timerKeyToSend) >= $timeKeyInterval * $countKeySent Then
Send($keyToSend)
$countKeySent += 1
EndIf
EndIf
WEnd

Func _TogglePause()
$running = Not $running
If $running Then
$countKeySent = 1
$timerKeyToSend = TimerInit()
EndIf
EndFunc

Func _Exit()
Exit
EndFunc
pady2211 is offline  
Old 09/02/2014, 13:11   #189
 
elite*gold: 2
Join Date: Jan 2014
Posts: 272
Received Thanks: 32
Hi, dafür musst du in der zweiten Zeile bei $timeKeyIntervall = 2000 einfach den Wert ändern.
Das ist in ms angegeben, also im moment ist es alle 2 Sekunden. Für eine Sekunde dann einfach auf 1000 stellen und so weiter.
maxmax37 is offline  
Old 09/02/2014, 13:16   #190
 
pady2211's Avatar
 
elite*gold: 0
Join Date: Feb 2011
Posts: 97
Received Thanks: 11
alles klar danke dir !
pady2211 is offline  
Old 09/03/2014, 21:59   #191

 
Moneypulation's Avatar
 
elite*gold: 138
Join Date: Apr 2012
Posts: 3,494
Received Thanks: 1,769
Quote:
Originally Posted by pady2211 View Post
Hey hab ne frage undzwar bräuchte ich jemanden der mir helfen kann ich habe gestern ein script bekommen in welchem die Leertaste Permanent gesendet werden soll (Das ist Perfekt) und dabei wird noch F4 gedrückt jetzt ist mein problem das F4 zu langsam gesendet wir kann mir das jemand schneller stellen?
Script:
Global Const $hotkeyPause = "{PAUSE}", $hotkeyExit = "{ESC}", $keyToSend = "{F4}"
Global Const $timeSleep = 10, $timeKeyInterval = 2000 ; time in ms
Global $running = False
Global $timerKeyToSend, $countKeySent

HotKeySet($hotkeyPause, "_TogglePause")
HotKeySet($hotkeyExit, "_Exit")

While Sleep($timeSleep)
If $running Then
Send("{SPACE}")
If TimerDiff($timerKeyToSend) >= $timeKeyInterval * $countKeySent Then
Send($keyToSend)
$countKeySent += 1
EndIf
EndIf
WEnd

Func _TogglePause()
$running = Not $running
If $running Then
$countKeySent = 1
$timerKeyToSend = TimerInit()
EndIf
EndFunc

Func _Exit()
Exit
EndFunc
Das ist doch KDeluxe's Code. Wieso hast du nicht ihn einfach gefragt?
Moneypulation is offline  
Old 09/03/2014, 22:14   #192
 
YatoDev's Avatar
 
elite*gold: 50
Join Date: Sep 2012
Posts: 3,841
Received Thanks: 1,462
* rechnen dauert länger als den timer wieder zurückzusetzen.
YatoDev is offline  
Old 09/04/2014, 22:48   #193
 
elite*gold: 0
Join Date: Mar 2009
Posts: 7,260
Received Thanks: 33,149
Das stimmt nicht. Den Timer zurückzusetzen kostet mehr Zeit als die Rechenoperation durchzuführen. Die ständige Neuberechnung des Wertes kostet aber zumindest in der Theorie mehr CPU Leistung, in der Praxis wirst du es nicht wahrnehmen können.
Das "Problem" mit der CPU kann man allerdings mit einer Zwischenvariable lösen. Hier wird dann zwar mehr Arbeitsspeicher benötigt aber nehmen wir mal an AutoIt behandelt die Variable als 64 Bit Zahl, dann kostet es in der Annahme ganze 8 Bytes an Arbeitsspeicher. 1 GB (eigentlich GiB) hat 1.073.741.824 Bytes. Auch das wird man in der Praxis nicht merken können (ist übrigens die beste Lösung).
Prüfen kann man es mit einem einfachen Script:
Code:
Const $count = 10000
Const $timeToWait = 1

$i = 1
$timer1 = TimerInit()
$timer2 = TimerInit()
While $i <= $count
    If TimerDiff($timer2) >= $timeToWait Then
        $i += 1
        $timer2 = TimerInit()
    EndIf
WEnd
ConsoleWrite(TimerDiff($timer1) & @CRLF)

$i = 1
$timer1 = TimerInit()
$timer2 = TimerInit()
While $i <= $count
    If TimerDiff($timer2) >= $timeToWait * $i Then
        $i += 1
    EndIf
WEnd
ConsoleWrite(TimerDiff($timer1) & @CRLF)

$i = 1
$timeToWait2 = $timeToWait
$timer1 = TimerInit()
$timer2 = TimerInit()
While $i <= $count
    If TimerDiff($timer2) >= $timeToWait2 Then
        $i += 1
        $timeToWait2 += $timeToWait
    EndIf
WEnd
ConsoleWrite(TimerDiff($timer1) & @CRLF)
Ausgabe:
Code:
10020.6012898994
10000.0034565278
10000.0042246451
Hier sieht man recht "deutlich", dass die ständige Zurücksetzung des Timers mehr Zeit beansprucht als die ständige Neuberechnung der abzuwartenden Zeit.

Zur Verdeutlichung habe ich es noch mit anderen Daten
Code:
Const $count = 12000
Const $timeToWait = 10
durchlaufen lassen:
Code:
120029.230319587
120000.003840586
120000.004608704
Während Lösung 2 und 3 konstant bleiben wächst die benötigte Zeit bei Lösung 1 (Zurücksetzung des Timers) proportional zur Laufzeit des Scripts.

Code:
Const $count = 120000
Const $timeToWait = 1
Code:
120282.833077742
120000.004992762
120000.004224645
KDeluxe is offline  
Old 09/26/2014, 21:08   #194
 
elite*gold: 0
Join Date: Sep 2014
Posts: 1
Received Thanks: 0
Hi.

Well, I would like to know how to add the function to Pausing and restarting the following script.
I want when I press "pause" return everything to normal (in this case when i press the key "a", the key "a" write only "a") and when I restart the script, press 2 keys at once (in this case when i press the key "a" , the key "a" write "v7").

How can i do it?... i tried many ways but nothing happened.

Thank you.

----------------------------------------------------------------
HotKeySet("{a}", "Press_v_and_7")
HotKeySet('{ESC}', '_EXIT')

Main()
Func Main()
While 1
Sleep(1000)
WEnd
EndFunc


Func Press_v_and_7()

Send("{v down}")
Send("{7 down}")
Send("{v up}")
Send("{7 up}")
Main()
EndFunc

Func _EXIT()
$iMsgBoxAnswer = MsgBox(0, "", "Goodbye")
Exit
EndFunc
--------------------------------------------------------------------------------------
Cascas89 is offline  
Old 09/27/2014, 13:44   #195
 
elite*gold: 0
Join Date: Mar 2009
Posts: 7,260
Received Thanks: 33,149
Code:
Global $running = False
Global Const $hotKeySend = "{a}", $hotKeyPause = "{PAUSE}", $hotKeyExit = "{ESC}"

HotKeySet($hotKeyPause, "_TogglePause")
HotKeySet($hotKeyExit, "_Exit")

While Sleep(1000)
WEnd

Func _SendVand7()
    Send("v")
    Send("7")
EndFunc

Func _TogglePause()
    $running = Not $running
    If $running Then
        HotKeySet($hotKeySend, "_SendVand7")
    Else
        HotKeySet($hotKeySend)
    EndIf
EndFunc

Func _Exit()
    Exit
EndFunc
KDeluxe is offline  
Reply


Similar Threads Similar Threads
AutoIt Script Requests
07/31/2008 - Dekaron - 10 Replies
Meh...bored with my scripts atm (releasing another tomorrow...), so I'm gonna ask you all what you want in a script. Post your ideas here.



All times are GMT +1. The time now is 10:44.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.