Unk Posted March 15, 2019 Posted March 15, 2019 I am trying to write a simple script to shovel dirt into a cart exactly 14 times and stop the script until I begin it again. I have never done any coding and have spent a good majority of the day figuring out all the jargon. I am currently stuck, I am sure I'm doing something wrong lol. Here it is: Local $Putincart= 0 Local $Startdig= 0 Do $Startdig= $Startdig+1 $Putincart= $Putincart+1 Until $Putincart = 14 And $Startdig = 1 func Startdig() WinActivate("Life is Feudal: MMO @ Godenland (Standard ruleset World)") MouseClick("left") ;begin digging EndFunc Func Putincart() Sleep(30000) ;wait 30s Send("{TAB}") ;tab out Sleep(100) MouseMove(2097,988,10) ;hover organize dirt MouseClick("left") ;click organize dirt Sleep(100) Send("{ALTDOWN}") ;hold alt (combine dirt) Sleep(100) MouseMove(2131,611,10) ;hover over dirt MouseClick("Left") ;click dirt Sleep(100) Send("{ALTUP}") ;let go of alt (combine dirt) Sleep(100) Send("{CTRLDOWN}") ;hold control (transfer dirt) Sleep(100) MouseMove(2131,611,10) ;hover dirt MouseClick("Left") ;click dirt Sleep(100) Send("{CTRLUP}") ;let go of control (transfer dirt) EndFunc func stop() exit EndFunc
badcoder123 Posted March 15, 2019 Posted March 15, 2019 Local $Putincart= 0 Local $Startdig= 0 Do $Startdig= $Startdig+1 $Putincart= $Putincart+1 Until $Putincart = 14 And $Startdig = 1 how does $Startdig ever = 1 and $Putincart = 14 at the same time?
Unk Posted March 15, 2019 Author Posted March 15, 2019 Huh I see your point. I am trying to get the first function to run once and the second to run 14 times after the first. So I could just call the startdig function and then do until for only putincart?
Unk Posted March 15, 2019 Author Posted March 15, 2019 10 minutes ago, badcoder123 said: Local $Putincart= 0 Local $Startdig= 0 Do $Startdig= $Startdig+1 $Putincart= $Putincart+1 Until $Putincart = 14 And $Startdig = 1 how does $Startdig ever = 1 and $Putincart = 14 at the same time? Call("Startdig") Next Local $Putincart= 0 Do $Putincart= $Putincart+1 Until $Putincart = 14 Call("stop") How about this?
jchd Posted March 15, 2019 Posted March 15, 2019 @Unk, you'd better read the forum rules! This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)
Developers Jos Posted March 15, 2019 Developers Posted March 15, 2019 Welcome to the AutoIt forum. Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. See you soon with a legitimate question I hope. The Moderation team SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Recommended Posts