Jump to content

Recommended Posts

Posted

Hello there!

I am new at scripts and all that, and I really need you'all's guys help!

I want to create a script, that presses a certain button continuously. For example pressing the button "B" every 0,5 seconds. I know it is something about "send" or something, and there is some unknown way for me to create a interval (i read the readme file), and i would also want to know more ways to make this script. Thank you guys in advance

Posted

i suggest you get familiar with the autoit helpfile and look after functions that sounds like what you want to do.

For example: MouseClick, Sleep, For...To...Step...Next

Especially look on the example scripts on every function.

Teamspeak 3 User Viewer - Quick and functional TS3 Query script, which shows online users.Cached Screenshot Deleter - Deletes older Fraps Screenshots if they exceed a specified limit.Unresolved Topics:Intercept and modify dragdrop text behaviour in scite
Posted

well i looked it up, it's a huge helpfile, but all i got was "send" stays for pressing buttons, and nothing else .. can't you just type it for me please =)

Posted (edited)

i suggest you get familiar with the autoit helpfile and look after functions that sounds like what you want to do.

For example: MouseClick, Sleep, For...To...Step...Next

Especially look on the example scripts on every function.

just type those words into the index, there is all you need

i got this part so far

send ("q")

Opt("SendKeyDelay", 50)

/

send ("q")

Sleep(2500)

what else? hot to make it do it again?

Edited by eNkee
Posted

oh you want to press a key on the keyboard, not a button in a window. You have to write more exactly what you want.

But anyway why do you not try Sleep and For?

Sleep = wait xxx miliseconds before continue to next line

for Loop = Loop the click and the sleep xx times

Teamspeak 3 User Viewer - Quick and functional TS3 Query script, which shows online users.Cached Screenshot Deleter - Deletes older Fraps Screenshots if they exceed a specified limit.Unresolved Topics:Intercept and modify dragdrop text behaviour in scite
Posted (edited)

While 1 = 1
   send ("q")
   Sleep(500)
Wend

Edited by toader

[center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Don't utter a single word[/font][/center][center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Just shut your pretty mouth[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you again[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you[/font][/center][center][font=courier new,courier,monospace]In hell[/font][/center]

Posted

While 1 = 1
   send ("q")
   Opt("SendKeyDelay", 500)
Wend
1) While 1 = 1 is not good

2) Why do you want to reset the SendKeyDelay on each iteration of the loop? It only needs setting once at the top of the script. A sleep() is what's needed and with more of the OPs code it may not even require that.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Posted

At the risk of hijacking this thread I'll ask for something other than an opinion as to what is "incorrect" or "bad" about using:

While 1 = 1

It may look bad to some of you and it is okay for you to state that opinion. But to say that it is bad or incorrect...... well, please tell me why. Is this going to be broken in some future release? I can not see how.

While <expression>
     statements
     ...
 WEnd

[size="1"][font="Arial"].[u].[/u][/font][/size]

Posted

It's just better to follow the guidelines set by the language documentation and the developers.

Then start preparing to use:

While True

:-)

[size="1"][font="Arial"].[u].[/u][/font][/size]

Posted

Then start preparing to use:

While True

:-)

True, true.

(Hey, the tag works!)

"While 1=1" isn't bad, it's just one extra computation that must be done.

In the grand scheme of things it's not going to have any impact.

So, everyone just relax and enjoy the game.

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Posted (edited)

Thank you guys =) helped :D

my first one was crazier

While $i <= 10
send ("b")
Sleep(100)
$i = $i + 0
WEnd

haha =)

Edited by eNkee
Posted

Thank you guys =) helped :D

my first one was crazier

While $i <= 10
send ("b")
Sleep(100)
$i = $i + 0
WEnd

haha =)

That was definitly crazy, particularily when you really stop and think about theis line

$i = $i + 0

If it was

$i += 1

then there is nothing wrong with that one.

As for why is While 1 = 1 bad? I wrote a long reply to that last night and then when I went to post it the forum was down for backup but here is the core argument. It works but it's a bad coding practice primarily because of the confusion it can cause new posters.

Will it be broken by future releases? Doubful. I don't think even Microsoft could break that and if they can't break it then nobody can.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Posted

yes, but of i would put $i += 1 then it would press the button just a certain ammount of time, until the sentence would be true, and in my case it would press it 10 times, because i wrote $i <= 10. but it worked! =)

Posted

yes, but of i would put $i += 1 then it would press the button just a certain ammount of time, until the sentence would be true, and in my case it would press it 10 times, because i wrote $i <= 10. but it worked! =)

Impossible because you never allowed $i to change. You kept it at whatever the starting value was by adding 0 to it. The only other possibility is that you changed it elswhere in your code and you didn't post that part.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

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
  • Recently Browsing   0 members

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