Sign in to follow this  
Followers 0
Bluewolf

Learning to Script - Need alittle Help

4 posts in this topic

Im new to AutoIt, Ive never in my years woulda guest this place existed, hahah

But I come from a few Diffrent Programing Languages, LSL(Secondlife Scripting) and MIRC(MIRC Scripting <-- Lame I know.) Also I do alittle Coding in TCL

Currently im working on a Script for the Game Holy Beast Online.

Now Ive seen Snow's Code and Im working on Something Alittle Diffrent.

HotKeySet("{home}", "Start")
HotKeySet("{end}", "Pause")
Func Pause()
    $game = "0"
    Play($game)
EndFunc
Func Start()
    $game = "1"
    Play($game)
EndFunc
Func Play(ByRef $a)
    if $game = "1" Then
        For $i = 1 to 100
            Send("{TAB}")
            Sleep(250)
            Send("1")
            Sleep(500)
            Send("3")
            Sleep(500)
            Send("2")
            Sleep(3000)
            Send("4")
        Next
    EndIf
EndFunc

Again ive never scripted in AutoIT Scripting so I litteraly have no Clue, I did this in like 10 Minutes of Looking at the Help file but Im kinda Stuck, Im working Towards trien to Detect in the IF Statement

If ($game != TRUE) {

Return

}

or

if ($game != 1) {

Return

}

But i have yet to find out how to do that, anyone wanna give a Helping hand? And explain to me alittle.

Please hahaha

Thanks.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I simply would use ELSE in your code. You set the values of $game so there is only "0" and "1" possible.

Func Play(ByRef $a)
  if $game = "1" Then
    For $i = 1 to 100
      Send("{TAB}")
      Sleep(250)
      Send("1")
      Sleep(500) 
      Send("3")
      Sleep(500)
      Send("2")
      Sleep(3000)
      Send("4")
    Next
  Else
    ... do something else ...
  EndIf
EndFunc
Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thanks, Now I just gotta find my Error in the Code HAHAHAHAH

To make this thing work.

Edited by Bluewolf

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  
Followers 0