Atti Posted January 20, 2005 Share Posted January 20, 2005 I'm trying to actively put different changing variables into a text box for easy display, and I'm hoping i wont have to write out each possible one instead of just putting variables in it...For instance:TrayTip ("Bot Status", "Waiting or Searching for a Target $hpp", 100)Is just saying...Bot StatusWaiting or Searching for a Target$hppif anyone has suggestions or a way around this, please help! Link to comment Share on other sites More sharing options...
Insolence Posted January 20, 2005 Share Posted January 20, 2005 Let me explain how this works: "Text" The interpreter (AutoIT Core, if you will) reads exactly what's inside there, it doesn't look for stuff to process, just 'reads' it back to the user. What you want to do is break out of this 'reading' and start 'processing', to do this: $Variable = "Apple Pie!" "Text" & $Variable That's just an example, you could also use a function: "Text" & Func1() Func Func1() Return "Apple Pie!" EndFunc Both would have the same result. "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar. Link to comment Share on other sites More sharing options...
Atti Posted January 20, 2005 Author Share Posted January 20, 2005 I tried both, and it still just returned the literal variable text: $hpp... Link to comment Share on other sites More sharing options...
Insolence Posted January 20, 2005 Share Posted January 20, 2005 Post your code? "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar. Link to comment Share on other sites More sharing options...
Atti Posted January 20, 2005 Author Share Posted January 20, 2005 You mean all of it? or just the relevant parts? Link to comment Share on other sites More sharing options...
Insolence Posted January 20, 2005 Share Posted January 20, 2005 All of it. "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar. Link to comment Share on other sites More sharing options...
Atti Posted January 20, 2005 Author Share Posted January 20, 2005 Ok.. its a bit of a mess since my editplus is being weird. expandcollapse popupWinActivate ("World of Warcraft") sleep(2000) ;Beginning Startup -- Waiting for the rest of the bot to start $loop = 0 TrayTip("Opening Atti's Rogue Bot", "Welcome to Atti's Rogue Bot! loading.", 2.5) Sleep(1300) TrayTip("Opening Atti's Rogue Bot", "Welcome to Atti's Rogue Bot! loading..", 2.5) Sleep(1300) TrayTip("Opening Atti's Rogue Bot", "Welcome to Atti's Rogue Bot! loading...", 2.5) Sleep(1300) TrayTip("Opening Atti's Rogue Bot", "Welcome to Atti's Rogue Bot! loading.", 2.5) Sleep(1300) TrayTip("Opening Atti's Rogue Bot", "Welcome to Atti's Rogue Bot! loading..", 2.5) Sleep(1300) TrayTip("Opening Atti's Rogue Bot", "Welcome to Atti's Rogue Bot! loading...", 20.5) Sleep(1400) While WinActive ( "World of Warcraft") = 1 ; Looping the Current Stats of the Bot While 1 $hpp = -1 Do sleep(200) $hp =PixelGetColor (162, 68) If $hp >= 40000 then If $hp <= 60000 then $hpp = 100 Endif Endif $hp =PixelGetColor (154, 68) If $hp >= 40000 then If $hp <= 60000 then $hpp = 90 Endif Endif $hp =PixelGetColor (146, 68) If $hp >= 40000 then If $hp <= 60000 then $hpp = 80 Endif Endif $hp =PixelGetColor (138, 68) If $hp >= 40000 then If $hp <= 60000 then $hpp =70 Endif Endif $hp =PixelGetColor (130, 68) If $hp >= 40000 then If $hp <= 60000 then $hpp =60 Endif Endif $hp =PixelGetColor (122, 68) If $hp >= 40000 then If $hp <= 60000 then $hpp =50 Endif Endif $hp =PixelGetColor (114, 68) If $hp >= 40000 then If $hp <= 60000 then $hpp = 40 Endif Endif $hp =PixelGetColor (106, 68) If $hp >= 40000 then If $hp <= 60000 then $hpp = 30 Endif Endif $hp =PixelGetColor (98, 68) If $hp >= 40000 then If $hp <= 60000 then $hpp = 20 Endif Endif $hp =PixelGetColor (90, 68) If $hp >= 40000 then If $hp <= 60000 then $hpp = 10 Endif Endif $hp =PixelGetColor (81, 68) If $hp >= 40000 then If $hp <= 60000 then $hpp = 0 Endif Endif IniWrite ("TrayInfo.ini", "condition", "hp", "$hpp") Until $hpp >= 0 Dim $hpp $hpp =IniRead("TrayInfo.ini", "condition", "hp", 0) TrayTip ("Bot Status", "Waiting or Searching for a Target" & hpreport($hpp), 100) Wend $loop = 0 Wend Func hpreport(Byref $hpp) Return "HP: $hpp" Endfunc Func Ext() ProcessClose("The Rogue Bot v2.exe") Sleep(100) ProcessClose("Autoit3.exe") Sleep(100) ProcessClose("TrayTip.exe") sleep(100) FileDelete("TrayInfo.ini") EndFunc If you hadn't guessed I'm new to Autoit and still don't really have a feeling for it. Link to comment Share on other sites More sharing options...
Atti Posted January 20, 2005 Author Share Posted January 20, 2005 This is also a multi-file bot... but this is the part im having trouble with.. Link to comment Share on other sites More sharing options...
Insolence Posted January 20, 2005 Share Posted January 20, 2005 (edited) IniWrite ("TrayInfo.ini", "condition", "hp", "$hpp")Just take the quotes out, did you read what I said? -.- Change it to this:IniWrite ("TrayInfo.ini", "condition", "hp", $hpp)Also, all those if's, no good you can get the same accomplished like so:$hp =PixelGetColor (162, 68) If $hp >= 40000 AND $hp If $hp <= 60000 then $hpp = 100 EndifAND you can see a pattern in those numbers, right? So lets step through each one:For [b]$i[/b] = 82 to 162 STEP 8 $hp =PixelGetColor ([b]$i[/b], 68) If $hp >= 40000 AND $hp If $hp <= 60000 then $hpp = 100 Endif NextI'll be going to bed soon, so please re-read anything if you don't understand it or use the help file. Edited January 20, 2005 by Insolence "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar. Link to comment Share on other sites More sharing options...
Atti Posted January 20, 2005 Author Share Posted January 20, 2005 Ok thanks, In the language that I'm used to coding in, you can't do alot of those things (a bit more repetitious) like stepping, etc. Thanks! Link to comment Share on other sites More sharing options...
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