sebbe133 Posted November 25, 2008 Posted November 25, 2008 Hi. To start with, I'm a beginner when it comes to AutoIt, just started a couple of days ago. And I'm sure you've heard this before, but I'm making myself a bot for a certain game. I've managed it decently until now. I need it to goto different stages of the botting, like in a batch file. Example: :start if exist C:\WINDOWS then goto lul else goto lal :lul echo found yerr windows dirr! :lal echo cannot find your windows dirr! zomg! :O And, I figured I had to use the Case statement, but now I'm not really sure.. The code: expandcollapse popupcase $search while 1 if PixelGetColor(431,165) <> 0x00BC00 then $attack else $walk endif WEnd Case $walk while 1 send("{TAB}") send("{W DOWN}") sleep(5300) send("{W UP}") send("{A DOWN}") sleep(5300) send("{A UP}") Sleep(random(1,2)*1000) WEnd case $attack $i = 0 while PixelGetColor(343,164) = 0x00BC00 AND $i <> 100 sleep(200) controlsend("World of Warcraft", "", "", 1) sleep(1200) controlsend("World of Warcraft", "", "", 2) sleep(1200) controlsend("World of Warcraft", "", "", 3) sleep(1200) controlsend("World of Warcraft", "", "", 4) sleep(1200) controlsend("World of Warcraft", "", "", 5) sleep(1200) controlsend("World of Warcraft", "", "", 6) sleep(1200) controlsend("World of Warcraft", "", "", 1) sleep(1200) controlsend("World of Warcraft", "", "", 2) sleep(1200) controlsend("World of Warcraft", "", "", 3) sleep(1200) controlsend("World of Warcraft", "", "", 4) sleep(1200) controlsend("World of Warcraft", "", "", 5) sleep(1200) controlsend("World of Warcraft", "", "", 6) sleep(1200) if PixelGetColor(343,164) = 0x00BC00 then $attack else $search WEnd
dbzfanatic Posted November 25, 2008 Posted November 25, 2008 Read the helpfile. It'll tell you what you need to know. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote]
sebbe133 Posted November 25, 2008 Author Posted November 25, 2008 (edited) Read the helpfile. It'll tell you what you need to know.Looking around for it as we speak. But since I'm new to AutoIt it's pretty hard.. mhzaah Edited November 25, 2008 by sebbe133
Uten Posted November 25, 2008 Posted November 25, 2008 Notice that you need a statement in the Select Case block. Local $var=0 Select case $Var = 1 ;Do this case $Var = 3 ;Do that case else ;Ups! What happend EndSelect Switch could be a better choice for you as it gives more flexibility. The help file is your friend.. Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling
sebbe133 Posted November 25, 2008 Author Posted November 25, 2008 Notice that you need a statement in the Select Case block.Switch could be a better choice for you as it gives more flexibility. The help file is your friend..<3 I love you man. I found this in the helpfile, but it said nothing to me Thanks.
November Posted November 25, 2008 Posted November 25, 2008 Notice that you need a statement in the Select Case block. Local $var=0 Select case $Var = 1 ;Do this case $Var = 3 ;Do that case else ;Ups! What happend EndSelect Switch could be a better choice for you as it gives more flexibility. The help file is your friend..Hi there m8, I looked at your code and i re-arranged my way. I use cases for multi results for the same variable. In your case if...else...endif it´s the better way, but for a clean view and debug i use funcs, take a look expandcollapse popupwhile 1 if PixelGetColor(431,165) <> 0x00BC00 then attack() else walk() EndIf WEnd func attack() $i = 0 sleep(200) controlsend("World of Warcraft", "", "", 1) sleep(1200) controlsend("World of Warcraft", "", "", 2) sleep(1200) controlsend("World of Warcraft", "", "", 3) sleep(1200) controlsend("World of Warcraft", "", "", 4) sleep(1200) controlsend("World of Warcraft", "", "", 5) sleep(1200) controlsend("World of Warcraft", "", "", 6) sleep(1200) controlsend("World of Warcraft", "", "", 1) sleep(1200) controlsend("World of Warcraft", "", "", 2) sleep(1200) controlsend("World of Warcraft", "", "", 3) sleep(1200) controlsend("World of Warcraft", "", "", 4) sleep(1200) controlsend("World of Warcraft", "", "", 5) sleep(1200) controlsend("World of Warcraft", "", "", 6) sleep(1200) EndFunc func walk() send("{TAB}") send("{W DOWN}") sleep(5300) send("{W UP}") send("{A DOWN}") sleep(5300) send("{A UP}") EndFunc Cheers Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font]
sebbe133 Posted November 25, 2008 Author Posted November 25, 2008 Hi there m8,I looked at your code and i re-arranged my way.I use cases for multi results for the same variable.CheersWow. Now I really wanna learn more AutoIt.. That's clean man Thanks alot!Hope to see you guys again
November Posted November 25, 2008 Posted November 25, 2008 Wow. Now I really wanna learn more AutoIt.. That's clean man Thanks alot!Hope to see you guys again You welcome take a look at this post from Brett, it's really good. Light and straight to the core of AutoIT.Brett's Great ManualCheers Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font]
liteswap Posted November 25, 2008 Posted November 25, 2008 You welcome take a look at this post from Brett, it's really good. Light and straight to the core of AutoIT.Brett's Great ManualCheers Code like func attack() is crying out for a couple of loops:CODEfunc attack() $i = 0 sleep(200) For $p = 1 To 2 For $n = 1 To 6 controlsend("World of Warcraft", "", "", $n) sleep(1200) next nextEndFunc
November Posted November 25, 2008 Posted November 25, 2008 Code like func attack() is crying out for a couple of loops:CODEfunc attack() $i = 0 sleep(200) For $p = 1 To 2 For $n = 1 To 6 controlsend("World of Warcraft", "", "", $n) sleep(1200) next nextEndFuncHi again,What kind of attack are you doing? I play WOW too, so try to check the time to cast/engage and do a sleep between attacks.Try to get also hoe many stroke with that magis are needed to get the enemy down.Cheers Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font]
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now