Jump to content
Sign in to follow this  
Mistico

I'm a noob :(

Recommended Posts

Mistico

First of all sorry for my english cause it's really poor. I am new to AutoIt and have been reading a lot the whole forums but as I don't have any programing knowledge it's becoming really difficult to me to understand how this works.

I am running Vista but guess this is not a problem.

I am trying to make a script for a game Rose online. I play on window mode not fullscren. What I want is very simple just a script that press F1 waits 9 seconds press again F1 waits 125sec, and repeat this as a loop.

What I am working so far is this script but it doesn't work:

HotKeySet("{Esc}", "ExitProg")

HotKeySet("{F12}", "StartProg")

While 1

Sleep(100)

Wend

Func StartProg()

while 1

SendKeepActive("Rose Online [Ver. 231]")

Send("{F1}" ,0)

Sleep(9000)

Send("{F1}" ,0)

Sleep(125000)

WEnd

EndFunc

Func ExitProg()

Exit 0

EndFunc

I hope you guys can help me. Thanks a lot in advance

Edited by Mistico

Share this post


Link to post
Share on other sites
LurchMan

Edit: Where is it erroring out at? what isn't working on it.

The only thing i potentially see not working correctly in this is SendKeepActive (). Add Opt('WinTitleMatchMode', 2) to the top of your script and see if it helps any.

Edited by LurchMan

Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end.

Share this post


Link to post
Share on other sites
Mistico

Edit: Where is it erroring out at? what isn't working on it.

The only thing i potentially see not working correctly in this is SendKeepActive (). Add Opt('WinTitleMatchMode', 2) to the top of your script and see if it helps any.

Added Opt('WinTitleMatchMode', 2) to the top of the script and removed the line SendKeepActive. Keeps not working.

What I do is the following. I have the game already opened in window mode this way I can see the script file at the left of the desktop. I run the script from there then alt tab to make the game window active and after that I press F12 to start the send function of the script. But nothing happens.

I see the Autoit icon on the tray next to the clock, if I right click it it say script paused.

Edited by Mistico

Share this post


Link to post
Share on other sites
LurchMan

Keep SendKeyActive, and also add Opt('TrayIconDebug', 1)

When you right click on the tray icon it will automatically go into paused mode. With the 2nd Opt that i just told you about, when you hover the mouse over the icon it will tell you what line it is currently executing.


Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end.

Share this post


Link to post
Share on other sites
Mistico

Keep SendKeyActive, and also add Opt('TrayIconDebug', 1)

When you right click on the tray icon it will automatically go into paused mode. With the 2nd Opt that i just told you about, when you hover the mouse over the icon it will tell you what line it is currently executing.

This is the script with the current changes :

Opt('WinTitleMatchMode', 2)

Opt('TrayIconDebug', 1)

HotKeySet("{Esc}", "ExitProg")

HotKeySet("{F12}", "StartProg")

While 1

Sleep(100)

Wend

Func StartProg()

while 1

SendKeepActive("Rose Online [Ver. 231]")

Send("{F1}" ,0)

Sleep(9000)

Send("{F1}" ,0)

Sleep(12500)

WEnd

EndFunc

Func ExitProg()

Exit 0

EndFunc

Keep having the same problem, I run the script, switch to game window, then when I press F12 I understand script should then send an F1 if the Rose window is active, but it doesn't send anything. When I hover the mouse over the tray icon is always on Line 7: Sleep(100) even if I press F12 while the mouse us over the icon the script keep being in Line 7.

Share this post


Link to post
Share on other sites
bogQ

Keep having the same problem, I run the script, switch to game window, then when I press F12 I understand script should then send an F1 if the Rose window is active, but it doesn't send anything. When I hover the mouse over the tray icon is always on Line 7: Sleep(100) even if I press F12 while the mouse us over the icon the script keep being in Line 7.

it cant work with F12 try F11 :)

Opt('WinTitleMatchMode', 2)
Opt('TrayIconDebug', 1)
HotKeySet("{Esc}", "ExitProg")
HotKeySet("{F11}", "StartProg")
SendKeepActive("Rose Online [Ver. 231]")

While 1
    Sleep(100)
Wend

Func StartProg()
    while 1
        Send("{F1}" ,0)
        Sleep(9000)
        Send("{F1}" ,0)
        Sleep(12500)
    WEnd
EndFunc

Func ExitProg()
    Exit
EndFunc

edit: from the help file on hotkey

F12 It is also reserved by Windows, according to its API.
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
Danith

This is the script with the current changes :

Opt('WinTitleMatchMode', 2)

Opt('TrayIconDebug', 1)

HotKeySet("{Esc}", "ExitProg")

HotKeySet("{F12}", "StartProg")

While 1

Sleep(100)

Wend

Func StartProg()

while 1

SendKeepActive("Rose Online [Ver. 231]")

Send("{F1}" ,0)

Sleep(9000)

Send("{F1}" ,0)

Sleep(12500)

WEnd

EndFunc

Func ExitProg()

Exit 0

EndFunc

Keep having the same problem, I run the script, switch to game window, then when I press F12 I understand script should then send an F1 if the Rose window is active, but it doesn't send anything. When I hover the mouse over the tray icon is always on Line 7: Sleep(100) even if I press F12 while the mouse us over the icon the script keep being in Line 7.

I'm new at this also and haven't used HotKeySet for anything yet.. does pushing a hotkey interrupt the loop? If not,

While 1

Sleep(100)

Wend

Is making an infinite loop..

edit: "A hotkey-press *typically* interrupts the active AutoIt function/statement and runs its user function until it completes or is interrupted."

Nevermind.. I see what it's doing. :)

Edited by Danith

Share this post


Link to post
Share on other sites
Mistico

Well just try it to change the hotkey to F11 as you suggested but doesn't start the function, not sending the F1. One more thing none of the HotkeySet are working cause I have to manually close the script by right clicking on the tray icon. Thanks for all this suggestions guys. Hopefully we will fix it.

Share this post


Link to post
Share on other sites
bogQ

Well just try it to change the hotkey to F11 as you suggested but doesn't start the function, not sending the F1. One more thing none of the HotkeySet are working cause I have to manually close the script by right clicking on the tray icon. Thanks for all this suggestions guys. Hopefully we will fix it.

did you tested it on notepad window (i did and it whas working)?

with the " but doesn't start the function" do you mean that your still stuck on "When I hover the mouse over the tray icon is always on Line 7: Sleep(100) "?

and the last question

does that game have anticheat protection? :)

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

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.