
lespoils
Active Members-
Posts
37 -
Joined
-
Last visited
lespoils's Achievements

Seeker (1/7)
0
Reputation
-
hi, I'm learning how to use the FF.au3 UDF. I'm trying to figure out the _IEPropertyGet ($oIE, "innertext") equivalent using the FF UDF. I basicaly want to get the text from the page and put it in a string. Any insight ? Thank you
-
Hi, i want to make a little log parser for neverwinter nights. i want to be able to make the window pop in the same way that xfire pops in. when you are in game, you press the defil+x combination and the xfire window comes over the game. it can even be set to a certain transparency. is that doable with autoit ? thx lespoils
-
u can if you habe firefox installed.
-
hi, about the instruction and the pet link: you have to use firefox, go to your facebook pets then click somewhere in the frame where the game is and select this frame -> show this frame only. your pet link is now in the adress bar. copy that to a IE browser if u don't use the gui. wich i suggest, the gui ins't finished. so just copy the pet link into a broswer and in the ini file put "usegui = 0". sorry about the lack of information. About the line 4 error: i think it's somthing new that facebook/eggmon put in to stop from using the script, tho i'm not sure as this never happened to me before and line 4 is "#include <Date.au3>" so i don't see why an error occurs there. also sometimes you get the "cannot find page" in the browser, this is also something that didnt hapen earlier. to be honest for now i have no plans of doing much work on the pet bot. but feel free to do any mods if you find work around about the line 4 or the cant find page glitches, post them ! If i do continue the bot, i will post it again. for sure Lespoils
-
I was asked to post the facebook pet bot i and 2 friends were working on. Use the ini file to configure the pet bot settings. we still miss the auto sell function and sometimes the bot hangs. but in overall u'll get to high levels real quick #include <GUIConstants.au3> #include <IE.au3> #Include <Misc.au3> #include <Date.au3> #include <Array.au3> Global $AMPM, $aSplit, $iCHK, $iCTime, $iPid Global $Button2, $Button3, $pets, $oIE, $site, $file, $usegui Global $antlvldif, $otherlvldif, $mantislvldif, $scorpionlvldif, $spiderlvldif iniload() _IEErrorHandlerRegister () $oIE = _IECreateEmbedded () if $usegui = 1 then Opt("GUIOnEventMode", 1) $pets = GUICreate("Pet Me", 900, 584, _ (@DesktopWidth - 1279) / 2, (@DesktopHeight - 797) / 2, _ $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $GUIActiveX = GUICtrlCreateObj($oIE, 5, 4, 730, 576) $Button1 = GUICtrlCreateButton("Start", 768, 495, 110, 25, 0) GUICtrlSetOnEvent(-1, "Start") $Button2 = GUICtrlCreateButton("Pause", 768, 525, 110, 25, 0) GUICtrlSetOnEvent(-1, "Stop") $Button3 = GUICtrlCreateButton("Close", 768, 555, 110, 25, 0) GUICtrlSetOnEvent($Button3, "Terminate") $iCTime = GUICtrlCreateLabel('Current Time' & @CRLF & _GetHour(@HOUR) & ':' & @MIN & ':' & @SEC & ' ' & $AMPM _ , 776, 10, 80, 37, 0x01, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) GUISetOnEvent($GUI_EVENT_CLOSE, "Terminate", $pets) GUISetState() EndIf _IENavigate ($oIE, $site) Stop() Func Stop() While 1 Sleep(100) WEnd EndFunc Func Terminate();Terminates the script Exit 0 EndFunc Func Start();This is where all the core functions a called in an eternal loop If $usegui <> 1 then $oIE = _IEAttach ("Pet me") EndIf Opt("GUIOnEventMode", 1) _IELoadWait ($oIE) $sText = _IEPropertyGet($oIE,"innertext") while 1 = 1 If StringRegExp($sText, 'Pet not showing up on your profile page?') = 0 then _IELoadWait ($oIE) Feed() _IELoadWait ($oIE) KillMonster() _IELoadWait ($oIE) FightorEvade() _IELoadWait ($oIE) fight() _IELoadWait ($oIE) Else if StringRegExp($sText, 'You are currently fighting a') = 0 then _IELinkClickByIndex ($oIE, 0) _IELoadWait ($oIE) KillMonster() _IELoadWait ($oIE) fight() _IELoadWait ($oIE) Else _IELoadWait ($oIE) KillMonster() _IELoadWait ($oIE) fight() _IELoadWait ($oIE) EndIf EndIf If $usegui <> 1 then $oIE = _IEAttach ("Pet me") EndIf $sText = _IEPropertyGet($oIE,"innertext") WEnd EndFunc Func FightOrEvade() If $usegui <> 1 then $oIE = _IEAttach ("Pet me") EndIf $sText = _IEPropertyGet($oIE,"innertext") dim $iEnemyLvl dim $iPetLvl if StringRegExp($sText, 'You are currently fighting a ') = 0 then ; This loop keeps on going until a monster is chosen to be fought. ;A monster can only be an Ant and can only be 1 lvl higher $while = 0 while $while = 0 ;This is where the decision begins If $usegui <> 1 then $oIE = _IEAttach ("Pet me") EndIf $sText = _IEPropertyGet($oIE,"innertext") $oTextTable = StringSplit (_IEPropertyGet($oIE,"innertext")," ") $oPetName = $oTextTable[1] ;this is the only way i found to be able to get a ;specific text string (the levels) from the web page for $i = 2 to $oTextTable[0] if StringRegExp($oTextTable[$i], 'Level') then if StringRegExp($oTextTable[$i-2], 'encountered') = 0 Then if StringRegExp($oTextTable[$i-1], $oPetName)=0 Then $iEnemyLvl = $oTextTable[$i+1] $iPetLvl = $oTextTable[$i+5] EndIf EndIf EndIf next if StringRegExp($sText, 'Ant') then ;checks the level difference. ;If it is okay, the Fight it button is clicked ;If it is not okay, the Evade button is clicked $iLvlDiff = $iPetLvl - $iEnemyLvl if $iLvlDiff > $antlvldif then $while = 1 ;this is how i choose a specific button from the page $oForms = _IEFormGetCollection ($oIE,0) $oElement = _IEFormElementGetCollection($oForms,4) _IELoadWait ($oIE) _IEAction($oElement,"click") _IELoadWait ($oIE) If $usegui <> 1 then $oIE = _IEAttach ("Pet me") EndIf $sText = _IEPropertyGet($oIE,"innertext") Else ;this is how i choose a specific button from the page $oForms = _IEFormGetCollection ($oIE,1) $oElement = _IEFormElementGetCollection($oForms,2) _IELoadWait ($oIE) _IEAction($oElement,"click") _IELoadWait ($oIE) If $usegui <> 1 then $oIE = _IEAttach ("Pet me") EndIf $sText = _IEPropertyGet($oIE,"innertext") EndIf Elseif StringRegExp($sText, 'Mantis') then ;checks the level difference. ;If it is okay, the Fight it button is clicked ;If it is not okay, the Evade button is clicked $iLvlDiff = $iPetLvl - $iEnemyLvl if $iLvlDiff > $mantislvldif then $while = 1 ;this is how i choose a specific button from the page $oForms = _IEFormGetCollection ($oIE,0) $oElement = _IEFormElementGetCollection($oForms,4) _IELoadWait ($oIE) _IEAction($oElement,"click") _IELoadWait ($oIE) If $usegui <> 1 then $oIE = _IEAttach ("Pet me") EndIf $sText = _IEPropertyGet($oIE,"innertext") Else ;this is how i choose a specific button from the page $oForms = _IEFormGetCollection ($oIE,1) $oElement = _IEFormElementGetCollection($oForms,2) _IELoadWait ($oIE) _IEAction($oElement,"click") _IELoadWait ($oIE) If $usegui <> 1 then $oIE = _IEAttach ("Pet me") EndIf $sText = _IEPropertyGet($oIE,"innertext") EndIf Elseif StringRegExp($sText, 'Scorpion') then ;checks the level difference. ;If it is okay, the Fight it button is clicked ;If it is not okay, the Evade button is clicked $iLvlDiff = $iPetLvl - $iEnemyLvl if $iLvlDiff > $scorpionlvldif then $while = 1 ;this is how i choose a specific button from the page $oForms = _IEFormGetCollection ($oIE,0) $oElement = _IEFormElementGetCollection($oForms,4) _IELoadWait ($oIE) _IEAction($oElement,"click") _IELoadWait ($oIE) If $usegui <> 1 then $oIE = _IEAttach ("Pet me") EndIf $sText = _IEPropertyGet($oIE,"innertext") Else ;this is how i choose a specific button from the page $oForms = _IEFormGetCollection ($oIE,1) $oElement = _IEFormElementGetCollection($oForms,2) _IELoadWait ($oIE) _IEAction($oElement,"click") _IELoadWait ($oIE) If $usegui <> 1 then $oIE = _IEAttach ("Pet me") EndIf $sText = _IEPropertyGet($oIE,"innertext") EndIf Elseif StringRegExp($sText, 'Spider') then ;checks the level difference. ;If it is okay, the Fight it button is clicked ;If it is not okay, the Evade button is clicked $iLvlDiff = $iPetLvl - $iEnemyLvl if $iLvlDiff > $spiderlvldif then $while = 1 ;this is how i choose a specific button from the page $oForms = _IEFormGetCollection ($oIE,0) $oElement = _IEFormElementGetCollection($oForms,4) _IELoadWait ($oIE) _IEAction($oElement,"click") _IELoadWait ($oIE) If $usegui <> 1 then $oIE = _IEAttach ("Pet me") EndIf $sText = _IEPropertyGet($oIE,"innertext") Else ;this is how i choose a specific button from the page $oForms = _IEFormGetCollection ($oIE,1) $oElement = _IEFormElementGetCollection($oForms,2) _IELoadWait ($oIE) _IEAction($oElement,"click") _IELoadWait ($oIE) If $usegui <> 1 then $oIE = _IEAttach ("Pet me") EndIf $sText = _IEPropertyGet($oIE,"innertext") EndIf Else $iLvlDiff = $iPetLvl - $iEnemyLvl if $iLvlDiff > $otherlvldif then $while = 1 ;this is how i choose a specific button from the page $oForms = _IEFormGetCollection ($oIE,0) $oElement = _IEFormElementGetCollection($oForms,4) _IELoadWait ($oIE) _IEAction($oElement,"click") _IELoadWait ($oIE) If $usegui <> 1 then $oIE = _IEAttach ("Pet me") EndIf $sText = _IEPropertyGet($oIE,"innertext") Else ;this is how i choose a specific button from the page $oForms = _IEFormGetCollection ($oIE,1) $oElement = _IEFormElementGetCollection($oForms,2) _IELoadWait ($oIE) _IEAction($oElement,"click") _IELoadWait ($oIE) If $usegui <> 1 then $oIE = _IEAttach ("Pet me") EndIf $sText = _IEPropertyGet($oIE,"innertext") EndIf EndIf WEnd EndIf EndFunc Func Feed();Feeds until energy is full iniload() If $usegui <> 1 then $oIE = _IEAttach ("Pet me") EndIf $sText = _IEPropertyGet($oIE,"innertext") while StringRegExp($sText, 'Your pet has full hit points, no need to eat ') = 0 ;this is how i choose a specific button from the page $oForms = _IEFormGetCollection ($oIE,1) $oElement = _IEFormElementGetCollection($oForms,3) _IELoadWait ($oIE) _IEAction($oElement,"click") if StringRegExp($sText, 'You are currently fighting a ') then ExitLoop $sText = _IEPropertyGet($oIE,"innertext") WEnd EndFunc Func KillMonster();Click on the Kill monster button from the main page If $usegui <> 1 then $oIE = _IEAttach ("Pet me") EndIf $oForms = _IEFormGetCollection ($oIE,3) $oElement = _IEFormElementGetCollection($oForms,0) _IELoadWait ($oIE) _IEAction($oElement,"click") _IELoadWait ($oIE) EndFunc Func Fight();Fights until monster dies than loots Losing a battle is not an option... If $usegui <> 1 then $oIE = _IEAttach ("Pet me") EndIf $sText = _IEPropertyGet($oIE,"innertext") while StringRegExp($sText, 'You have killed a|Pet not showing up|You have died') = 0 ;this is how i choose a specific button from the page $oForms = _IEFormGetCollection ($oIE,0) $oElement = _IEFormElementGetCollection($oForms,0) _IEAction($oElement,"click") If StringRegExp($sText, 'Pet not showing up on your profile page?') Then ExitLoop If StringRegExp($sText, 'You have died') Then ExitLoop $sText = _IEPropertyGet($oIE,"innertext") WEnd ;wait untill the page loads before click loot _IELoadWait ($oIE) if StringRegExp($sText, 'You have killed a') then ;this is how i choose a specific button from the page $oForms = _IEFormGetCollection ($oIE,0) $oElement = _IEFormElementGetCollection($oForms,4) _IELoadWait ($oIE) _IEAction($oElement,"click") _IELoadWait ($oIE) elseif StringRegExp($sText, 'Pet not showing up') then _IELinkClickByIndex ($oIE, 0) _IELoadWait ($oIE) KillMonster() _IELoadWait ($oIE) fight() _IELoadWait ($oIE) EndIf If StringRegExp($sText, 'You have died') then $oForms = _IEFormGetCollection ($oIE,0) $oElement = _IEFormElementGetCollection($oForms,4) _IELoadWait ($oIE) _IEAction($oElement,"click") _IELoadWait ($oIE) EndIf EndFunc Func _AdlibManager() Local $aSplit = StringSplit(GUICtrlRead($iCTime), ':') If $aSplit[0] >= 3 And (Int($aSplit[1]) >= _GetHour(@HOUR) _ Or Int($aSplit[2]) >= @MIN Or Int(StringTrimRight($aSplit[3], 3)) > @SEC) Then _ GUICtrlSetData($iCTime, 'Current Time' & @CRLF & _GetHour(@HOUR) & ':' & @MIN & ':' & @SEC & ' ' & $AMPM) EndFunc Func _GetHour($iHour) Switch $iHour Case 12 $AMPM = 'PM' Return $iHour Case 13 To 23 $AMPM = 'PM' Return $iHour - 12 Case 0 $AMPM = 'AM' Return 12 Case 1 To 11 $AMPM = 'AM' Return $iHour EndSwitch EndFunc Func _SwitchHour($iHour) Switch $iHour Case 12 If $AMPM = 'AM' Then Return 0 Else Return 12 EndIf Case 1 To 11 If $AMPM = 'PM' Then Return $iHour + 12 Else Return $iHour EndIf EndSwitch EndFunc func iniload() ;Keys $usehotkeys = IniRead("zarox.ini", "keys", "usehotkeys", "1") ;Fight $antlvldif = IniRead("zarox.ini", "fight", "antleveldifference", "-2") $mantislvldif = IniRead("zarox.ini", "fight", "mantisleveldifference", "3") $spiderlvldif = IniRead("zarox.ini", "fight", "spiderleveldifference", "3") $scorpionlvldif = IniRead("zarox.ini", "fight", "scorpionleveldifference", "3") $otherlvldif = IniRead("zarox.ini", "fight", "otherleveldifference", "3") ;Other $site = IniRead("zarox.ini", "other", "petlink", "http://www.facebook.com") $usegui = IniRead("zarox.ini", "other", "usegui", "0") If $usehotkeys = 1 Then $endkey = IniRead("zarox.ini", "keys", "closekey", "") HotKeySet($endkey, "Terminate") $startkey = IniRead("zarox.ini", "keys", "startkey", "") HotKeySet($startkey, "Start") $pausekey = IniRead("zarox.ini", "keys", "pausekey", "") HotKeySet($pausekey, "Stop") EndIf EndFunc and the ini, my ini was called zarox.ini you can change the name but u'll have to change the ini file name in the code also. else just name it zarox.ini. also u'll have to add your pet link in the ini. here it is CODE[keys] usehotkeys = 1 *** IF usehotkeys=1 then you have to set what keys you want to use. *** *** the key you wish to use MUST have { } around it!! *** *** Example: closekey={DEL} *** closekey= {esc} startkey = +!s pausekey = +!p [fight] *** Lower the number the high level monster you attack *** antleveldifference = 0 mantisleveldifference = 2 spiderleveldifference = 1 scorpionleveldifference = 4 otherleveldifference = 2 [other] *** IF usegui=1 then a gui menu will open and you need to *** *** paste your link in petlink.. IF usegui=0 then you have *** *** to get your petlink and paste it in IE then start. *** usegui = 1 petlink = ADD YOUR PET LINK HERE have fun Comments and suggestions are always welcomed Lespoils
-
Hey guys ! Just got back from vacation, i'll have to look at all the modification tomorow. for tonight im too tired. Glad to see new people are interrested Lespoils
-
Golbez, maybe a new post would work best, i doubt anybody is gonna answer on this one anymore
-
yeah if u want to make this script work put ; in front of each $oIE = _IEAttach ("Pet me") lines. they have to be commented out or deleted Lespoils
-
You can also put a timer to _IELoadWait to wait before looking if the page is loaded. so i guess that is better than a sleep or a _IELoadWait alone. Just to let you know Lespoils
-
didn't read all the code, i will when i get home. but if u want to wait for a page to load i suggest u use the _IELoadWait($oIE) function read the help to know how it works, it's pretty easy. I'll try to help more when i get home. Best Regards Lespoils
-
just added you to my msn
-
i'll add comments on all the lines so you know whats happening func Fight() ;locks onto the page $oIE = _IEAttach ("Pet me") ;puts all the text from the page in a string $sText = _IEPropertyGet($oIE,"innertext") ;while there is nothing in the string that equals 'You have killed a', ;it keeps click on attack/defend while StringRegExp($sText, 'You have killed a') = 0 ;this is how i choose a specific button from the page ;each element of the page has some kinda of ID i had to find this one by trial and error ;the var $oElement has a reference to the button attack/defend $oForms = _IEFormGetCollection ($oIE,0) $oElement = _IEFormElementGetCollection($oForms,0) ;no _IELoadWait() here to have quicker battle ;usualy i wrap the click command into a _IELoadWait, seemed a lot less buggy _IEAction($oElement,"click") ;Before exiting the While get the focus back on the page $oIE = _IEAttach ("Pet me") $sText = _IEPropertyGet($oIE,"innertext") WEnd ;wait untill the page loads before click loot, _IELoadWait ($oIE) ;if there is some text that looks like 'You have killed a' do this if StringRegExp($sText, 'You have killed a') then ;this is how i choose a specific button from the page $oForms = _IEFormGetCollection ($oIE,0) $oElement = _IEFormElementGetCollection($oForms,4) _IELoadWait ($oIE) _IEAction($oElement,"click") _IELoadWait ($oIE) elseif StringRegExp($sText, 'You have died') then MsgBox (0, "dead", "your dead") EndIf EndFuncoÝ÷ Øay-èJÚâ^LiÓ~¬MìmßÖ(º¯yØwméì¥u·¢Ø^Z¥y¦è½ë(ëax%G+"v'g¶ÚòÛ(Ù¢g¢ÚÞjYrÂänëb·ljËZ®Ö®¶s`b33c¶ôfvFærÒ¢vÆRb33c¶ôfvFærÒ b7G&æu&VtWb33c·5FWBÂb33µ÷RfR¶ÆÆVBb33²FVà b33c¶ôfvFærÒ ¶Fò6öFRvVâfvB2FöæP VÇ6P 7G&æu&VtWb33c·5FWBÂb33µ÷RfRFVBb33²FVâ b33c¶ôfvFærÒ ¶Fò6öFRvVâ÷RFV@ VÇ6P ¶Fòæ÷&ÖÂfvFær6öFP VæF`¢VæD`¢tVæ i think the hardest thing is to get the focus on the finish button. if you look at the comment i added u'll see how i got the focus on the different button. start from there. Thanks for the help Golbez and i hope this gives you a good start. Lespoils
-
if u put it to -1 it'll fight only ants your level, if u put it to 0 it'll only fight ants 1 level lower than u. For myself i put anyother monster to 4 lvl lower than me, because scorpions are really strong even if u have 3 lvls higher than them. Hope this helps
-
Okay Yes, this is a good idea. Thx Golbez When i get home (5pm too), if the script is still running, i'll post it again. and i'll start on the AutoSell Function. Another thing that can be nice, is to find a way to simply run the script and it would open the right IE page. so that we do not need to go through FireFox. but again this is less important than getting the script glitchless and adding the autosell function. Lespoils
-
Zarox you are right about the inv not all showing, when you will sell more items the chimera gear will show up. The bot worked pretty much all night yesterday as i manage to get to 40million xp (LV 25 TOO ) and when i went to bed i was at 30 million. I hope i finally corrected the glitch *cross fingers* As for Golbez, thank you for your interrest ! you're more than welcome to help out ! but i don't see right away the mods you've made and why is the #inclue <misc.au3> necessary. Work on the code but try to mark out the changes And for the gui, i agree with both of you it would be an interresting feature but i also feel the auto loot selling function is more interresting for now. If the script is still running when i get back from work, i'll work on the AutoSell function. Cheers Lespoils