Help - Search - Members - Calendar
Full Version: Help pwease :(
AC Tools Everything Macro > AC Tool > AC Tool Discussion
saffire
Hai, well, I am new to this forum (but not to ACTool tongue.gif) and, first off, I am 16 years old and my name is Kayla smile.gif. So, I know how to do most
of the stuff in ACTool, and I have made many pointless bots, and I am actually working on a tutorial for this, but, I need some help first tongue.gif.
Well, earlier today, i just learned how to use the "IF" and "ELSE" functions, but, I have three questions. 1- Can i have more than just those two
too occupy the variable? I mean, in the code, is it possible to somehow have more than 1 "IF" and "ELSE"? For example:

Constants
k1 = 3 //1 = wait 1 second untill it starts to type, 2 = 5 seconds, 3 = 15 seconds.
ExecProgram Notepad.exe
delay 500
SetActiveWindow Untitled - Notepad
If $k1 = 1
Delay 1000
Else $k1 = 2
Delay 5000
<What do I put here?> $k1 = 3
Delay 15000
end
say Hai, I'm Kayla x3

//END//

I have tried to put "if" on the third one, and also else. But can't seem to make it work sad.gif
Ok, question 2-What is the function "And" for? I actually tried to put this in after the "Else" function in my mini-script, but it said wrong function or
whatever.
Last question- Is the function "And" in anyway associated with the "If" and "Else" functions? tongue.gif
Any help is absolutely awesome! Thankies! smile.gif
- Your newest member!!
Kayla <3


Okay, now, I tried again, with this following code:


Constants
k1 = 2
end
ExecProgram Notepad.exe
delay 500
Setactivewindow Untitled - Notepad
If $k1 = 0
Delay 1000
Else $k1 = 1
Delay 5000
If $k1 = 2
Delay 10000
end
end
Say Hi

And, it somewhat worked but, instead of only doing the " If $k1 = 2 blah blah " it did Else $k1 = 1 and If $k1 = 2 sad.gif
Helpppp meee! hehe. Thank you in advance!! biggrin.gif
- Your newest member and friend
Kayla <3
DaMOB
QUOTE(saffire @ Apr 8 2009, 01:58 AM) *
Hai, well, I am new to this forum (but not to ACTool tongue.gif) and, first off, I am 16 years old and my name is Kayla smile.gif. So, I know how to do most
of the stuff in ACTool, and I have made many pointless bots, and I am actually working on a tutorial for this, but, I need some help first tongue.gif.
Well, earlier today, i just learned how to use the "IF" and "ELSE" functions, but, I have three questions. 1- Can i have more than just those two
too occupy the variable? I mean, in the code, is it possible to somehow have more than 1 "IF" and "ELSE"? For example:

Constants
k1 = 3 //1 = wait 1 second untill it starts to type, 2 = 5 seconds, 3 = 15 seconds.
ExecProgram Notepad.exe
delay 500
SetActiveWindow Untitled - Notepad
If $k1 = 1
Delay 1000
Else $k1 = 2
Delay 5000
<What do I put here?> $k1 = 3
Delay 15000
end
say Hai, I'm Kayla x3

//END//

I have tried to put "if" on the third one, and also else. But can't seem to make it work sad.gif
Ok, question 2-What is the function "And" for? I actually tried to put this in after the "Else" function in my mini-script, but it said wrong function or
whatever.
Last question- Is the function "And" in anyway associated with the "If" and "Else" functions? tongue.gif
Any help is absolutely awesome! Thankies! smile.gif
- Your newest member!!
Kayla <3


Okay, now, I tried again, with this following code:


Constants
k1 = 2
end
ExecProgram Notepad.exe
delay 500
Setactivewindow Untitled - Notepad
If $k1 = 0
Delay 1000
Else $k1 = 1
Delay 5000
If $k1 = 2
Delay 10000
end
end
Say Hi

And, it somewhat worked but, instead of only doing the " If $k1 = 2 blah blah " it did Else $k1 = 1 and If $k1 = 2 sad.gif
Helpppp meee! hehe. Thank you in advance!! biggrin.gif
- Your newest member and friend
Kayla <3
So close.

The problem lies in the fact that ACTool has no elseif statement like C++ etc... so you have to break it down.

CODE
Constants
k1 = 2
end
ExecProgram Notepad.exe
delay 500
Setactivewindow Untitled - Notepad

if $k1 = 0
  Delay 1000
end
if $k1 = 1
  Delay 5000
end
if $k1 = 2
  Delay 10000
end
say Hi

saffire
Thank you, but, then why did the "else" statement work? ohmy.gif, is it only if you want to do 2? And also, what's the "And" statement for? It's bugging me biggrin.gif. Thank you in advance.
- Your newest member and friend
Kayla <3
Bear
You can also Nest IF statements, Second one can follow the Else statement.
CODE
Constants
k1 = 3 //1 = wait 1 second untill it starts to type, 2 = 5 seconds, 3 = 15 seconds.
End

ExecProgram Notepad.exe
delay 500
SetActiveWindow Untitled - Notepad
If $k1 = 1
Timestamp K1 ( $K1 )
Delay 1000
Else
IF $k1 = 2
Timestamp K1 ( $K1 )
Delay 5000
Else
Timestamp K1 ( $K1 )
Delay 15000
end
END
say Hai, I'm Kayla x3
saffire
[quote name='Bear' date='Apr 8 2009, 02:50 PM' post='76293']
You can also Nest IF statements, Second one can follow the Else statement.
[quote]

Hi Bear, I am unfimiliar with the "Timestamp" you have in the code, does it do anything special, or can i just leave it out? Thank you smile.gif
- Your newest member and friend
Kayla <3
Bear
QUOTE(saffire @ Apr 8 2009, 12:57 PM) *
QUOTE(Bear @ Apr 8 2009, 02:50 PM) *

You can also Nest IF statements, Second one can follow the Else statement.
QUOTE


Hi Bear, I am unfimiliar with the "Timestamp" you have in the code, does it do anything special, or can i just leave it out? Thank you smile.gif
- Your newest member and friend
Kayla <3

Timestamping is a Way to DEBUG your Scripts, look in the Test Log Tab after the Macro has run.

To answer your other question "AND" - if you want the IF statement to meet more than one condition. The other is "OR" and you can't mix "and" & "OR" in one IF statement.

This is example code, it's not meant to be ran.
CODE
IF $J = 1 and $K = 1 and $L = 5
// True
Else
  //False
  IF $J <> 1 or $K < 1
   // True
  Else
  //False
  End
End
DaMOB
QUOTE(Bear @ Apr 8 2009, 01:50 PM) *
You can also Nest IF statements, Second one can follow the Else statement.
CODE
Constants
k1 = 3 //1 = wait 1 second untill it starts to type, 2 = 5 seconds, 3 = 15 seconds.
End

ExecProgram Notepad.exe
delay 500
SetActiveWindow Untitled - Notepad
If $k1 = 1
Timestamp K1 ( $K1 )
Delay 1000
Else
IF $k1 = 2
Timestamp K1 ( $K1 )
Delay 5000
Else
Timestamp K1 ( $K1 )
Delay 15000
end
END
say Hai, I'm Kayla x3
Yep, you can do this but for a novice it can make their heads swim so I only bring them up when I am sure the person understands the simpler method. Apparently they did not.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.