-
Posts
98 -
Joined
-
Last visited
Profile Information
-
Location
Myrtle Beach, SC
jacob_1998_1999's Achievements
Wayfarer (2/7)
0
Reputation
-
(Solved)Type future date? _DateAdd()
jacob_1998_1999 replied to jacob_1998_1999's topic in AutoIt General Help and Support
This is my updated script if anyone decides to build off of it in the future. #include Global $Paused Opt("TrayIconHide", 1) HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("{Insert}", "InsertTime") $PasteThis = ("Attack After: ") While 1 Sleep(100) ToolTip('Running.', 0, 0) Local $sNewDate = _DateAdd('n', 10080, _NowCalc()) WEnd Func TogglePause() $Paused = Not $Paused While $Paused Sleep(100) ToolTip('Script is "Paused"', 0, 0) WEnd ToolTip("") EndFunc ;==>TogglePause Func Terminate() Exit 0 EndFunc ;==>Terminate Func InsertTime() Send ($PasteThis & $sNewDate) EndFunc ;==>ShowMessage -
(Solved)Type future date? _DateAdd()
jacob_1998_1999 replied to jacob_1998_1999's topic in AutoIt General Help and Support
If anyone else actually decides to use this, Remember simple things like... If you're going to call this, put it in the while loop. You'll never update the time, if you just create the variable when the program is ran.. You need to continuously have it updating the time. Just a little FYI. -
(Solved)Type future date? _DateAdd()
jacob_1998_1999 replied to jacob_1998_1999's topic in AutoIt General Help and Support
*** You can't use +.. Forgot to use & to combine variables. -
(Solved)Type future date? _DateAdd()
jacob_1998_1999 replied to jacob_1998_1999's topic in AutoIt General Help and Support
k, apparently, I got it... Syntax errors... #include <Date.au3> Global $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("{Insert}", "InsertTime") Local $sNewDate = _DateAdd('n', 10080, _NowCalc()) $PasteThis = ("Attack After: ") While 1 Sleep(100) WEnd Func TogglePause() $Paused = Not $Paused While $Paused Sleep(100) ToolTip('Script is "Paused"', 0, 0) WEnd ToolTip("") EndFunc ;==>TogglePause Func Terminate() Exit 0 EndFunc ;==>Terminate Func InsertTime() Send ($PasteThis & $sNewDate) EndFunc ;==>ShowMessage -
(Solved)Type future date? _DateAdd()
jacob_1998_1999 replied to jacob_1998_1999's topic in AutoIt General Help and Support
I'm apparently skipping something.. I can't output the variable.. O_o Msgbox works, but Send will not.. Tried various things.. /headdesk.. The variable only outputs "2012" skips all Text and will not output the "/" apparently. #include Date.au3 Global $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("{Insert}", "InsertTime") Local $sNewDate = _DateAdd('n', 10080, _NowCalc()) MsgBox(4096, "", "Don't attack before: " & $sNewDate) $PasteThis = ("Attack After: " + String($sNewDate)) While 1 Sleep(100) WEnd Func TogglePause() $Paused = Not $Paused While $Paused Sleep(100) ToolTip('Script is "Paused"', 0, 0) WEnd ToolTip("") EndFunc ;==>TogglePause Func Terminate() Exit 0 EndFunc ;==>Terminate Func InsertTime() Send("This is lame...") Send ($PasteThis) Send ($sNewDate) EndFunc ;==>ShowMessage -
(Solved)Type future date? _DateAdd()
jacob_1998_1999 replied to jacob_1998_1999's topic in AutoIt General Help and Support
Well damn, that is much simpler than the mess that I threw together. Ty. -
I have a little script written out to type out the present time/date on hotkey.My problem is that I would like it to actually type the date of 7 days in advance.I just don't know the technique to apply such a thing. Would anyone be able toguide me to a solution? Please and thank you. Global $PausedHotKeySet("{PAUSE}", "TogglePause")HotKeySet("{ESC}", "Terminate")HotKeySet("{Insert}", "InsertTime")$time=_GetTodaysDate()While 1 Sleep(100)WEndFunc TogglePause() $Paused = Not $Paused While $Paused Sleep(100) ToolTip('Script is "Paused"', 0, 0) WEnd ToolTip("")EndFunc ;==>TogglePauseFunc Terminate() Exit 0EndFunc ;==>TerminateFunc InsertTime() _GetTodaysDate()Send ($Time)EndFunc ;==>ShowMessageFunc _GetTodaysDate($iReturnTime = 1) Local $aMDay[8] = [7, "Sun", "Mon", "Tue", "Wed", "Thur", "Fri", "Sat"], _ $aMonth[13] = [12, "Jan", "Feb", "Mar", "Apr", "May", "June", "July", "Aug", "Sept", "Oct", "Nov", "Dec"], $aTime[2] = ["", ' ' & @HOUR & ':' & @MIN & ':' & '00'] Return $aMDay[@WDAY] & ', ' & @MDAY & ' ' & $aMonth[@MON] & ' ' & @YEAR & $aTime[$iReturnTime]EndFunc ;==>_GetTodaysDate
-
First of all, Thank you PSaltyDS. That RegEx is quite lovely. Sadly though.. I do not know how to edit the incoming HTML(add the extra quotes) with it on the fly. I still cannot even manage to get what you've written to show up in a msgbox. I'm going to include a sample HTML file. I'm certain there is a way to pull from raw html and end up with variables that contain values from the same source. My goal is to have these variables available to be used in a script that I've written/am writing for this particular game.. So.. If the variable $user_health = <100 It would be told to go to a specific URL which would heal. Of course there is a little more to it than that. Thank you everyone that has tried so far to help me. jobs.htm
-
Below is HTML that I am pulling. These are not variables. $('user_group_size').innerHTML = "1489"; $('user_cash').innerHTML = "$198,519,293"; $('user_health').innerHTML = "323"; $('user_max_health').innerHTML = "323"; $('user_energy').innerHTML = "20"; $('user_max_energy').innerHTML = "120"; $('user_stamina').innerHTML = "12"; $('user_max_stamina').innerHTML = "15"; $('user_experience').innerHTML = "142006"; $('exp_for_next_level').innerHTML = "142507"; $('user_level').innerHTML = "150"; I would like to convert this HTML to stand alone variables for use with autoit. $('user_health').innerHTML = "323"; would convert to $user_health = 323, dynamically. (I hope I understood enough of what you said to get across what I'm trying to do.)
-
$('\w+').innerHTML\s=\s"\d+"; or.. something like $('(.*?)').innerHTML\s=\s"(.*?)"; $Variable = $('(.*?)').innerHTML\s=\s".*?"; $Val = $('.*?').innerHTML\s=\s"(.*?)"; Is there a way to get around the quote issue? I've tried searching. (and is my syntax correct?) I know that I can get between the ' quote by using.. if($var =~ m/'(.*)'/) { print "\nextract is $1 \n"; } but thats perl. ;P Once again, thank you for any and all help.
-
I'm trying to get the values out of these fields that I will be pulling from source every 20 seconds. I'll most likely end up using the various variables in a GUI or just standard MsgBox's queried by shortcut keys. $('user_group_size').innerHTML = "1489"; $('user_cash').innerHTML = "$198,519,293"; $('user_health').innerHTML = "323"; $('user_max_health').innerHTML = "323"; $('user_energy').innerHTML = "20"; $('user_max_energy').innerHTML = "120"; $('user_stamina').innerHTML = "12"; $('user_max_stamina').innerHTML = "15"; $('user_experience').innerHTML = "142006"; $('exp_for_next_level').innerHTML = "142507"; $('user_level').innerHTML = "150"; I'd like to put them into variables such as: $user_group_size = "1489" $user_cash = "$198,519,293" $user_health = "323" $user_max_health = "323" $user_energy = "20" $user_max_energy = "120" $user_stamina = "12" $user_max_stamina = "15" $user_experience = "142006" $exp_for_next_level = "142507" $user_level = "150" Any guidance would be much appreciated. *Edited to add values to the variables.. to clear up any doubts. Edit to include below: Could I possibly just get enough help to search for this " $('user_health').innerHTML = "323"; " (I can't reg stringinstr because of the ' and " quotes..) I would like to get the number so that I can run it against a If $user_health < 100 Then Blah(). I'm just stuck as to how to get about the quotes.. Once again.. Any help would be awesome. #include <IE.Au3> #include <inet.au3> $job_url = "http://" ;~ $oIE = _IECreate ("about:blank",0,1,1,0) ;~ _IELoadWait($oIE,1000) ;~ _IENavigate ($oIE, $job_url) ;~ _IELoadWait($oIE,1000) ;~ $sHTML = _IEDocReadHTML ($oIE) ;~ $UserHealthStringA = "user_health" ;~ $UserHealthStringB = '= "' ;MsgBox(0,"",StringInStr($sHTML, $UserHealthStringA)) ;$user_health = StringRegExp($sHTML,'innerHTML\s=\s"(.*?)"',1) ;~;MsgBox(0,"",_IEPropertyGet ($oIE, "body")) ;~ $user_group_size = "" ;~ $user_cash = "" ;~ $user_health = "" ;~ $user_max_health = "" ;~ $user_energy = "" ;~ $user_max_energy = "" ;~ $user_stamina = "" ;~ $user_max_stamina = "" ;~ $user_experience = "" ;~ $exp_for_next_level = "" ;~ $user_level = "" ;~ $Blah = 'Joes dat'"a said Beer!""' ConsoleWrite(_GetName()) Func _GetName() HttpSetProxy(0) Local $sSource = _INetGetSource($job_url) Local $sRetName = StringRegExpReplace($sSource, _ '.innerHTML\s=\s"(.*?)"','\1 \2 \3 \4 \5 \6') msgbox(1,"", $sRetName) EndFunc;==> _GetName I have tried.. I just do not know where to go to do this myself.
-
Heavy IE.au3 usage results in Lock up.
jacob_1998_1999 replied to jacob_1998_1999's topic in AutoIt General Help and Support
Thank you very much Dale. I've made the changes you suggest, I'll let the script run and see what happens. Jacob -
Leaving the following script running does very strange things to my computer.. It will not allow my to right click on the desktop, Press Ctrl+Alt+Delete, It refuses to let my computer be shutdown without it being a Hard Reboot. I'm using WinXP Home SP3. I have a 3 ghz dual core processor and 3 gigs of Ram. Is there something obviously wrong in my code that would prevent extended usage? The code works, for all means it was made.. and will continue to work even when my computer has become unresponsive. However, when I terminate the script, my computer does not return to working order. Is there a more efficient method for calling a direct URL query? Is there a more efficient method to go about what I am trying to accomplish? I am sorry for the novice coding. I am trying to get better. #include <IE.au3> Global $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{Insert}", "Switch1") HotKeySet("{Printscreen}", "Switch2") ; defined variables were here. $num = 0 $tog = 0 Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is Paused. ' & $num & ' cycles.',0,0) WEnd ToolTip("") EndFunc Func Switch1() If $tog = 1 Then $tog = 0 EndFunc Func Switch2() If $tog = 0 Then $tog = 1 EndFunc Func Jobs() $oIE = _IECreate ("about:blank",0,$tog,1,0) _IELoadWait($oIE,1000) _IENavigate ($oIE, $hosp_url) _IELoadWait($oIE,1000) _IENavigate ($oIE, $job_url) _IELoadWait($oIE,1000) _IENavigate ($oIE, $job2_url) _IELoadWait($oIE,1000) _IENavigate ($oIE, $job3_url) _IELoadWait($oIE,1000) ;~ _IENavigate ($oIE, $benjob) ;~ _IELoadWait($oIE,1000) _IENavigate ($oIE, $1job) _IELoadWait($oIE,1000) _IENavigate ($oIE, $2job) _IELoadWait($oIE,1000) _IENavigate ($oIE, $3job) _IELoadWait($oIE,1000) _IENavigate ($oIE, $4job) _IELoadWait($oIE,1000) _IENavigate ($oIE, $5job) _IELoadWait($oIE,1000) _IENavigate ($oIE, $6job) _IELoadWait($oIE,1000) _IENavigate ($oIE, $7job) _IELoadWait($oIE,1000) _IENavigate ($oIE, $8job) _IELoadWait($oIE,1000) _IENavigate ($oIE, $9job) _IELoadWait($oIE,1000) _IENavigate ($oIE, $10job) _IELoadWait($oIE,1000) _IEQuit($oIE) EndFunc Func Hits() $oIE = _IECreate ("about:blank",0,$tog,1,0) _IELoadWait($oIE,1000) _IENavigate ($oIE, $hosp_url) _IELoadWait($oIE,1000) _IENavigate ($oIE, $hit_url) _IELoadWait($oIE,1000) _IENavigate ($oIE, $hit2_url) _IELoadWait($oIE,1000) _IENavigate ($oIE, $hit3_url) _IELoadWait($oIE,1000) _IENavigate ($oIE, $hit) _IELoadWait($oIE,1000) ;~ _IENavigate ($oIE, $1hit) ;~ _IELoadWait($oIE,1000) ;~ _IENavigate ($oIE, $2hit) ;~ _IELoadWait($oIE,1000) ;~ _IENavigate ($oIE, $3hit) ;~ _IELoadWait($oIE,1000) ;~ _IENavigate ($oIE, $4hit) ;~ _IELoadWait($oIE,1000) ;~ _IENavigate ($oIE, $5hit) ;~ _IELoadWait($oIE,1000) ;~ _IENavigate ($oIE, $6hit) ;~ _IELoadWait($oIE,1000) ;~ _IENavigate ($oIE, $7hit) ;~ _IELoadWait($oIE,1000) ;~ _IENavigate ($oIE, $8hit) ;~ _IELoadWait($oIE,1000) ;~ _IENavigate ($oIE, $9hit) ;~ _IELoadWait($oIE,1000) ;~ _IENavigate ($oIE, $10hit) ;~ _IELoadWait($oIE,1000) _IEQuit($oIE) EndFunc Func Hospital() $oIE = _IECreate ("about:blank",0,$tog,1,0) _IELoadWait($oIE,1000) _IENavigate ($oIE, $hosp_url) _IELoadWait($oIE,1000) _IENavigate ($oIE, $hosp2_url) _IELoadWait($oIE,1000) _IENavigate ($oIE, $hosp3_url) _IELoadWait($oIE,1000) _IEQuit($oIE) EndFunc Func Bank() $oIE = _IECreate ("about:blank",0,$tog,1,0) _IELoadWait($oIE,1000) _IENavigate ($oIE, $hosp_url) _IELoadWait($oIE,1000) _IENavigate ($oIE, $bank3_url) _IELoadWait($oIE,1000) _IENavigate ($oIE, $1bank) _IELoadWait($oIE,1000) _IENavigate ($oIE, $2bank) _IELoadWait($oIE,1000) _IENavigate ($oIE, $3bank) _IELoadWait($oIE,1000) _IENavigate ($oIE, $4bank) _IELoadWait($oIE,1000) _IENavigate ($oIE, $5bank) _IELoadWait($oIE,1000) _IENavigate ($oIE, $6bank) _IELoadWait($oIE,1000) _IENavigate ($oIE, $7bank) _IELoadWait($oIE,1000) _IENavigate ($oIE, $8bank) _IELoadWait($oIE,1000) _IENavigate ($oIE, $9bank) _IELoadWait($oIE,1000) _IENavigate ($oIE, $10bank) _IELoadWait($oIE,1000) _IEQuit($oIE) EndFunc Func Fight() $oIE = _IECreate ("about:blank",0,$tog,1,0) _IELoadWait($oIE,1000) _IENavigate ($oIE, $hosp_url) _IELoadWait($oIE,1000) _IENavigate ($oIE, $fight_url) _IELoadWait($oIE,1000) _IENavigate ($oIE, $1fight) _IELoadWait($oIE,1000) _IENavigate ($oIE, $2fight) _IELoadWait($oIE,1000) _IENavigate ($oIE, $3fight) _IELoadWait($oIE,1000) _IENavigate ($oIE, $4fight) _IELoadWait($oIE,1000) _IENavigate ($oIE, $5fight) _IELoadWait($oIE,1000) _IENavigate ($oIE, $6fight) _IELoadWait($oIE,1000) _IENavigate ($oIE, $7fight) _IELoadWait($oIE,1000) _IENavigate ($oIE, $8fight) _IELoadWait($oIE,1000) _IENavigate ($oIE, $9fight) _IELoadWait($oIE,1000) _IENavigate ($oIE, $10fight) _IELoadWait($oIE,1000) _IEQuit($oIE) EndFunc while 1 Jobs() Fight() Bank() Hospital() Hits() $num = $num + 1 WEnd Thanks a lot. Jacob
-
_IECreate vs _IEAttach
jacob_1998_1999 replied to jacob_1998_1999's topic in AutoIt General Help and Support
You're very correct, I used yours while testing, then reverted to adding it back at the end of the total While loop. For more testing. =) I understood what you did. Thank you again for the assistance. -
I was under the impression that it would append indefinitely. #include <File.au3> _FileWriteToLine ( $sFile, $iLine, $sText [, $fOverWrite] ) Parameters $sFile The file to write to $iLine The line number to write to $sText The text to write $fOverWrite if set to 1 will overwrite the old line if set to 0 will not overwrite ;Example: Write to line 3 of c:\test.txt NOT REPLACING line 3 _FileWriteToLine("c:\test.txt", 3, "my insertion", 0) Sorry for the misunderstanding if I am mistaken.