Jump to content

HotKeys? Too much?


 Share

Recommended Posts

Hi there! im using hotkeys, i got hotkey on number 1 to 9 and on some buttons like q,w, a, s, d and f

I got the hotkeys to give command to click there its choosed and write in a link then press enter 2 times.

This is an easier and faster way to play this game impulse im playing (swedish "click" game). And its legal, and i will also public my program when its done in theirs forum.

Problem with this is that when i try it now its go to the place and type in the link, the whole link isn't typed before it clicks again and type the link, over and over again!

Hard to close even if i have hotkey on that {ESC} key i got it on.

I was delete every HotKey expect one that i keeped, i run it and that is working!

BUT as fast i make alot more its going crazy >_>

My question is.. WHY?

1 of these codes under a hotkey function

Func Fri()

MouseClick("left", $pos[0], $pos[1])

Send("http://impulse.nu/?sida=vakter&q=fri")

Send("{ENTER}")

Sleep(300)

Send("{ENTER}")

EndFunc

Link to comment
Share on other sites

Whats that _IsPressed !!?!? >_>

And btw, i know now that only 1 hotkey is working also..

THIS is how the code looks now

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;Programmed by HaZeL;;;;;;;;;;;;;;;

;;;;;;;;;;;;;To Impulse.nu;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Global $Paused

HotKeySet("{PAUSE}", "Pause")

HotKeySet("{ESC}", "Quit")

HotKeySet("{SPACE}", "Cord")

;Jobb

HotKeySet("{1}", "Bensinmack")

HotKeySet("{2}", "Bank")

;Energifrukter

HotKeySet("{q}", "N1")

HotKeySet("{w}", "N2")

;ETC

HotKeySet("{a}", "Fri")

;-----------------------------------------------------------------------------------

;BÖRJA KODERNA EFTER DENNA LINJE! (Här uppe ska bara hotkeysets funktioner vara inklusive Global)

;-----------------------------------------------------------------------------------

$set = 0

While 1

$pos = MouseGetPos()

$var = Tooltip( $pos[0] & ", " & $pos[1],0,0, "Position")

Sleep(100)

if $set = 1 then

GoGoGo()

EndIf

WEnd

Func GoGoGo()

InputBox("Kordinater", "Skriv in kordinaterna för din Web Browser!",$pos[0] & ", " & $pos[1])

Sleep(500)

Tooltip("")

While 1

Sleep(100)

WEnd

EndFunc

$done = $pos

;-----------------------------------------------------------------------------------

;Hotkeys funktionerna här nere!

;-----------------------------------------------------------------------------------

Func Pause()

$Paused = NOT $Paused

While $Paused

sleep(100)

ToolTip('Scriptet är pausad!',0,0,"Pausat")

WEnd

ToolTip("")

EndFunc

Func Quit()

ToolTip('Scriptet avslutas...',0,0,"Avslutas")

Sleep(1000)

ToolTip("")

Exit 0

EndFunc

;Jobb

Func Bensinmack()

MouseClick("left", $done[0], $done[1])

Send("http://impulse.nu/?sida=jobb/olagliga_jobb&q=bensinmack&p=redo")

Send("{ENTER}")

Sleep(300)

Send("{ENTER}")

EndFunc

Func Bank()

MouseClick("left", $done[0], $done[1])

Send("http://impulse.nu/?sida=jobb/olagliga_jobb&q=bank&p=redo")

Send("{ENTER}")

Sleep(300)

Send("{ENTER}")

EndFunc

;Energifrukter

Func N1()

MouseClick("left", $done[0], $done[1])

Send("http://impulse.nu/?sida=stan/frukter&kop=1")

Send("{ENTER}")

Sleep(300)

Send("{ENTER}")

EndFunc

Func N2()

MouseClick("left", $done[0], $done[1])

Send("http://impulse.nu/?sida=stan/frukter&kop=2")

Send("{ENTER}")

Sleep(300)

Send("{ENTER}")

EndFunc

Func Fri()

MouseClick("left", $done[0], $done[1])

Send("http://impulse.nu/?sida=vakter&q=fri")

Send("{ENTER}")

Sleep(300)

Send("{ENTER}")

EndFunc

Func Cord()

$set = 1

EndFunc

Link to comment
Share on other sites

try adding:

Opt("SendKeyDelay", 250) at the top of your script, if that's too slow, decrease the value.

I was just try it out! didn't work!

And btw, last code i sent, was pretty wrong, i mean there it will be $pos instead of $done for the $done didn't work!

I also think that its something wrong when i was write the code for $pos! BUT WHAT and how!?

I was try that SendKeyDelay and it was type the whole link, then it was start over again! (and it was half lagging and pretty hard to close the program)

Also whole right code i got now that not working ;S

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;Programmed by HaZeL;;;;;;;;;;;;;;;

;;;;;;;;;;;;;To Impulse.nu;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Global $Paused

HotKeySet("{PAUSE}", "Pause")

HotKeySet("{ESC}", "Quit")

HotKeySet("{SPACE}", "Cord")

;Jobb

HotKeySet("{1}", "Bensinmack")

HotKeySet("{2}", "Bank")

;Energifrukter

HotKeySet("{q}", "N1")

HotKeySet("{w}", "N2")

;ETC

HotKeySet("{a}", "Fri")

;-----------------------------------------------------------------------------------

;BÖRJA KODERNA EFTER DENNA LINJE! (Här uppe ska bara hotkeysets funktioner vara inklusive Global)

;-----------------------------------------------------------------------------------

$set = 0

While 1

$pos = MouseGetPos()

$var = Tooltip( $pos[0] & ", " & $pos[1],0,0, "Position")

Sleep(100)

if $set = 1 then

GoGoGo()

EndIf

WEnd

Func GoGoGo()

InputBox("Kordinater", "Skriv in kordinaterna för din Web Browser!",$pos[0] & ", " & $pos[1])

Sleep(500)

Tooltip("")

While 1

Sleep(100)

WEnd

EndFunc

$done = $pos

;-----------------------------------------------------------------------------------

;Hotkeys funktionerna här nere!

;-----------------------------------------------------------------------------------

Func Pause()

$Paused = NOT $Paused

While $Paused

sleep(100)

ToolTip('Scriptet är pausad!',0,0,"Pausat")

WEnd

ToolTip("")

EndFunc

Func Quit()

ToolTip('Scriptet avslutas...',0,0,"Avslutas")

Sleep(1000)

ToolTip("")

Exit 0

EndFunc

;Jobb

Func Bensinmack()

MouseClick("left", $pos[0], $pos[1])

Send("http://impulse.nu/?sida=jobb/olagliga_jobb&q=bensinmack&p=redo")

Send("{ENTER}")

Sleep(300)

Send("{ENTER}")

EndFunc

Func Bank()

MouseClick("left", $pos[0], $pos[1])

Send("http://impulse.nu/?sida=jobb/olagliga_jobb&q=bank&p=redo")

Send("{ENTER}")

Sleep(300)

Send("{ENTER}")

EndFunc

;Energifrukter

Func N1()

MouseClick("left", $pos[0], $pos[1])

Send("http://impulse.nu/?sida=stan/frukter&kop=1")

Send("{ENTER}")

Sleep(300)

Send("{ENTER}")

EndFunc

Func N2()

MouseClick("left", $pos[0], $pos[1])

Send("http://impulse.nu/?sida=stan/frukter&kop=2")

Send("{ENTER}")

Sleep(300)

Send("{ENTER}")

EndFunc

Func Fri()

MouseClick("left", $pos[0], $pos[1])

Send("http://impulse.nu/?sida=vakter&q=fri")

Send("{ENTER}")

Sleep(300)

Send("{ENTER}")

EndFunc

Func Cord()

$set = 1

EndFunc

Link to comment
Share on other sites

ALSO! The thing that is wrong MUST be the $pos :) i dont know rly why i think so but i just do it! Because it work perfect if i only have one hotkey with the $pos in it! But if i make 2 or more it wont work!!!!

WHY!? I dont know whats really wrong :S Someone who can just re-program it with the $pos!?

Link to comment
Share on other sites

Use the _IE* UDF instead, it will work a million times better.

What you mean? :) Whats that?

I'm not that experienced in AutoIT programming and those stuffs because i was start with AutoIT for like 4 days ago and just can some basics as you probly see..

Link to comment
Share on other sites

Check the helpfile! :)

Read about the func's and run the examples, you won't get any spoon-feeding on this forum you gotta do something yourself!

You can atleast explain wtf it is for type of function and what its doing and why etc.

The helpfile got around 100000000000 maps

Link to comment
Share on other sites

Isn't it obvious? IE= Internet Explorer. So now you know what it is now give it a try yourself

I am using Internet Explorer already.

And whats _IE* UDF

The _ and * UDF

Well, i will anyway read now in the help file and might make a gui to it too if im good enough or if this language is to bad and i go back to VB :)

Link to comment
Share on other sites

You gotta be kidding me.... You haven't even opened the helpfile have you?

Go to "User Defined Functions">"IE Management". I suggest you start with _IE_Introduction().

And before you say something else, think about this= If you spend a few minutes to learn the _IE*() funcs you will be able to run the script on every computer that exist that uses Win2000 to Win7 and have IE installed. Will you be able to do that with Send() and MouseClick()?? Hell no. Will you be able to do it in VB?? I don't know and I don't care, this is a forum for AutoIt.

Link to comment
Share on other sites

Look in the helpfile for IE.au3. Under the User Defined Functions, you will see a section called IE management. Read it, look at the examples, try a few things. It isn't hard. For only doing code for 4 days, you are picking it up rather quickly.

A second thing to do is try AutoIt 1 2 3

Link to comment
Share on other sites

You gotta be kidding me.... You haven't even opened the helpfile have you?

Go to "User Defined Functions">"IE Management". I suggest you start with _IE_Introduction().

And before you say something else, think about this= If you spend a few minutes to learn the _IE*() funcs you will be able to run the script on every computer that exist that uses Win2000 to Win7 and have IE installed. Will you be able to do that with Send() and MouseClick()?? Hell no. Will you be able to do it in VB?? I don't know and I don't care, this is a forum for AutoIt.

LoL dude!

Serious, i've check help file and i not find anything named IE Management :S

But also i was go to the example maps with ALOT of example files and was find _IE examples.. I was try them out some of them.. But well... It would be alot easier if i was find them in help file so i can read about them too :)

Not even User Defined Functions does exist.. And i was look in every map now if there was something about IE or internet but not founded

Want me make a movie as proof there i look in dam every map?

Link to comment
Share on other sites

LoL dude!

Serious, i've check help file and i not find anything named IE Management :S

But also i was go to the example maps with ALOT of example files and was find _IE examples.. I was try them out some of them.. But well... It would be alot easier if i was find them in help file so i can read about them too :)

Not even User Defined Functions does exist.. And i was look in every map now if there was something about IE or internet but not founded

Want me make a movie as proof there i look in dam every map?

LoL! Well i found it -.-' it was in the exe file..

But dude. I was look some examples there, and about to open internet explorer... All exempels was open a new internet explorer window? I would need that its just chaning thecurrently web browser so..

[EDIT]

GAAH! NVM -.-' (didn't saw it was navigate)

Close thread or whatever.. I will fix this in my own way and not bee a leecher! But i rly wanted make this done quick :)

Edited by DragoooN
Link to comment
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
 Share

  • Recently Browsing   0 members

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