Jump to content
Sign in to follow this  
critan

I need help with simple script please?

Recommended Posts

critan

I am new to the program and i need help on making a simple(well not to me lol) script that loops Send(1)

and on the side loops send(2) at in interval of some seconds(like 30sec) any help would be appreciated =D

Share this post


Link to post
Share on other sites
bo8ster

try looking at the help file for things like Send, Sleep and Loop Statements.


Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Share this post


Link to post
Share on other sites
critan

try looking at the help file for things like Send, Sleep and Loop Statements.

I have done that, I tried and didn't work for me probably did it wrong or something i would like to have help on this still please.

Share this post


Link to post
Share on other sites
EndFunc

I have done that, I tried and didn't work for me probably did it wrong or something i would like to have help on this still please.

Can you paste the code of what you tried? If you have something to work with that might help.


EndFuncAutoIt is the shiznit. I love it.

Share this post


Link to post
Share on other sites
critan

Can you paste the code of what you tried? If you have something to work with that might help.

alright here is what i have(just to let u know i have no idea what i am doing)

Do

Send(1)

ContinueLoop

Do

sleep(30)

send(2)

ContinueLoop

Share this post


Link to post
Share on other sites
TerarinK

First did you read how to use sleep? That will tell you it is in milliseconds


0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E

Share this post


Link to post
Share on other sites
critan

First did you read how to use sleep? That will tell you it is in milliseconds

yeh i know its just and example i just want it to work b4 i change that

Share this post


Link to post
Share on other sites
TerarinK

This is all you need to do what you want:

While 1
    Send("1")
    Sleep(30000)
    Send("2")
WEnd

Why do you have two loops anyhow will no ending? Anyways you have to have a variable or else it is a string with "" around there to send it.


0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E

Share this post


Link to post
Share on other sites
critan

This is all you need to do what you want:

While 1
    Send("1")
    Sleep(30000)
    Send("2")
WEnd

Why do you have two loops anyhow will no ending? Anyways you have to have a variable or else it is a string with "" around there to send it.

it has no ending cuz i want it to keep doing send(1) while in the other hand another loop that waits(so many sec) then do send(2) and loops that loop seperatly

Share this post


Link to post
Share on other sites
TerarinK

else if you like from what I read:

While 1
    Send("1")
    For $i = 1 To 5
        Sleep(300)
        Send("2")
    Next
WEnd

This can be changed in any way to get what you would like. Just for a sample view of the possible loops look at the Continueloop of Exitloop functions


0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E

Share this post


Link to post
Share on other sites
TerarinK

you still need a ending to return false everytime on a Do Until if you want it to run forever

Do
    Send("1")
    Sleep(300)
    Send("2")
Until False

0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E

Share this post


Link to post
Share on other sites
critan

you still need a ending to return false everytime on a Do Until if you want it to run forever

Do
    Send("1")
    Sleep(300)
    Send("2")
Until False

i did this

Do

Send(1)

until False

Do

Sleep(300)

Send(2)

Until False

but it doesnt send(2) also

Share this post


Link to post
Share on other sites
TerarinK

That is because you send 1 forever you need to in corporate the 2 inside the function else you need a escape from the function whatever it is

Do
    Send(1)
    Sleep(300)
    Send(2)
Until False

Just watch out for the second one as the whole thing needs to be inside a loop if you want to keep repeating the pattern. Also use $Something as more elaborate then that with say turn true


0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E

Share this post


Link to post
Share on other sites
TerarinK

Because

until false

will never be false

Your sadly wrong on that, as it will always remain False forever those repeating the pattern till the end of time. I guessing you never test out any scripts that you talk about?

0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E

Share this post


Link to post
Share on other sites
critan

so its impossible to do 2 seperate loops within the same loop? send (1) loops , then another loop send (2) at same time? i need them seperate.

if that makes any sense???

Share this post


Link to post
Share on other sites
TerarinK

It is impossible to do the threaded this is a single-thread app. Your best bet would to be doing them in two different apps and executing them both, that would be the only way to execute them both at the same time. What kinda game is this for anyways? Because almost every game I know of only executes one command at a time.


0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E

Share this post


Link to post
Share on other sites
critan

It is impossible to do the threaded this is a single-thread app. Your best bet would to be doing them in two different apps and executing them both, that would be the only way to execute them both at the same time. What kinda game is this for anyways? Because almost every game I know of only executes one command at a time.

uh its for aeria games: Shin Megami Tensei:Imagine(aka MegaTen) http://megaten.aeriagames.com/

oh ok ill do that then and ty for the help =)

Share this post


Link to post
Share on other sites
bogQ

AdlibEnable("myadlib",5000)
While 1
    ToolTip("hi",0,0)
WEnd
Func myadlib()
    ToolTip("how r y?",0,0)
    Sleep(1000)
EndFunc

I still dont understand what r y trying to say but i hope this helps :unsure:

or try TimerDiff :P

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
TerarinK

ahhh, you should get whatever you do and incorporate it into the function else you'll be sending mass amounts of data the the game will trash and then flag for you spamming. You'll get most likely BAN from the game most game have a least a second wait till whatever.

Do
    Sleep(1000)
    Send(1)
Until False

Do
    Sleep(30000)
    Send(2)
Until FalseoÝ÷ Øz0z÷«¶¬©j[(v¬¶¨ç(f§uú+{ºØ¨©ÝÁ¨­±ú+¶ºw-í¡ø§È[+^rëbazw±´w«z+mëmzº'zÇ+_¢¹®¬¨¹Æ§ºÇ¢·±yË­x-+ºÚ"µÍÌÍÝ[YHH[Y[]

BÌÍÝ[YH[Y[]

BÚ[HBRY[YY ÌÍÝ[YJH  ÝÏHL[BTÙ[
    ][ÝÌI][ÝÊBBIÌÍÝ[YHH[Y[]

BQ[YRY[YY   ÌÍÝ[YH   ÝÏHÌ[BTÙ[
    ][ÝÌ][ÝÊBBIÌÍÝ[YH[Y[]

BQ[YÑ[

0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E

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  

×