» Site Navigation | | | » Advertisement | | | » Recent Threads | | | | | | | PotW #18! Today 06:40 AM Today 03:42 PM 1 Replies, 29 Views | | | |  |  | Gaia Online Haloween Bot Functions |  |
10-25-2008, 09:51 PM
|
#1 (permalink)
| Banned
Join Date: Jul 2007 Posts: 228
GPoints: 1,713 Rep Power: 0 | Gaia Online Haloween Bot Functions Code: 'Functions that we have no use for in a diffrent program
'RareDareDevil
'-----------------Global Declarations (used anywhere in program)-----------'
Global GameHealth As String 'Players Health
Global GameEnergy As String 'Players Energy
Global PlayerClass As String 'Players Class
Global PlayerTeam As String 'Players Team
Global PlayerLevel As String 'Players Level
Global PlayerRank As String 'Players Rank
Global PlayerAttack As String 'Players attack skill level
Global PlayerDefense As String 'Players Defense skill level
Global PlayerSkillPoints As String 'Skill Points
Public Function Game_UpdateStats()
'Pulls all stats from the current page
'If a stat is not found on the page then we keep the old one
If Extract_health <> -1 Then
GameHealth = Extract_health
End If
If Extract_Energy <> -1 Then
GameEnergy = Extract_Energy
End If
If Len(Extract_Team) > 0 Then
PlayerTeam = Extract_Team
End If
checkmaxlevel
FrmMain.lblstats = "Health: " & GameHealth
FrmMain.lblstats = FrmMain.lblstats & vbNewLine & "Energy: " & GameEnergy
FrmMain.lblstats = FrmMain.lblstats & vbNewLine & "Team: " & PlayerTeam
End Function
Public Function Game_AttackPlayer()
Dim atkurl As String
'strhtml = FrmMain.wrapper.GetWrapper("http://www.gaiaonline.com/forum/f.459", FrmMain.wrapper.LastPage)
temp = GetStringBetween(strhtml, " Human ", "act_button attack_button")
If Len(temp) < 1 Then
temp = GetStringBetween(strhtml, " Vampire ", "act_button attack_button")
End If
If Len(temp) < 1 Then
temp = GetStringBetween(strhtml, " Dark Elf ", "act_button attack_button")
End If
atkurl1 = GetStringBetween(temp, "a href='", "'")
atkurl = "http://www.gaiaonline.com" & atkurl1
strhtml = FrmMain.wrapper.GetWrapper(atkurl, FrmMain.wrapper.LastPage)
If InStr(strhtml, ">Unwelcome Massage</label>") Then
strhtml = FrmMain.wrapper.GetWrapper(atkurl & "&do=choose&ability_id=94", FrmMain.wrapper.LastPage)
If InStr(strhtml, "You can act again in") > 1 Then
FrmMain.LstLog.AddItem (Time() & " Attacked player using Unwelcome Massage")
Game_UpdateStats
Exit Function
End If
End If
If InStr(strhtml, ">Rotting Grope</label>") Then
strhtml = FrmMain.wrapper.GetWrapper(atkurl & "&do=choose&ability_id=98", FrmMain.wrapper.LastPage)
If InStr(strhtml, "You can act again in") > 1 Then
FrmMain.LstLog.AddItem (Time() & " Attacked player using Rotting Grope")
Game_UpdateStats
Exit Function
End If
End If
If InStr(strhtml, ">Invade Personal Space</label>") Then
strhtml = FrmMain.wrapper.GetWrapper(atkurl & "&do=choose&ability_id=92", FrmMain.wrapper.LastPage)
If InStr(strhtml, "You can act again in") > 1 Then
FrmMain.LstLog.AddItem (Time() & " Attacked player using Invade Personal Space")
Game_UpdateStats
Exit Function
End If
End If
If InStr(strhtml, ">Crumbling Hug</label>") Then
strhtml = FrmMain.wrapper.GetWrapper(atkurl & "&do=choose&ability_id=86", FrmMain.wrapper.LastPage)
If InStr(strhtml, "You can act again in") > 1 Then
FrmMain.LstLog.AddItem (Time() & " Attacked player using Crumbling Hug")
Game_UpdateStats
Exit Function
End If
If InStr(strhtml, ">Gruesome Smile</label>") Then
strhtml = FrmMain.wrapper.GetWrapper(atkurl & "&do=choose&ability_id=78", FrmMain.wrapper.LastPage)
If InStr(strhtml, "You can act again in") > 1 Then
FrmMain.LstLog.AddItem (Time() & " Attacked player using Gruesome Smile")
Game_UpdateStats
Exit Function
End If
End If
If InStr(strhtml, ">Friendly Glare</label>") Then
strhtml = FrmMain.wrapper.GetWrapper(atkurl & "&do=choose&ability_id=84", FrmMain.wrapper.LastPage)
If InStr(strhtml, "You can act again in") > 1 Then
FrmMain.LstLog.AddItem (Time() & " Attacked player using Friendly Glare")
Game_UpdateStats
Exit Function
End If
End If
End If
End Function
Function Extract_health() As String
'Returns player health from html source
'Html:
' <tr id='health_stats'>
' <td>Health: </td>
' <td><div class='meter' style='width: 90px;'><div class='meter_left'></div><div class='meter_fill red' style='width: 84px;'></div><div class='meter_right'></div></div></td>
' <td>(100/100)</td>
' </tr>
' <tr id='energy_stats'>
Str1 = GetStringBetween(strhtml, "health_stats", "energy_stats")
'Str1 now contains all the html between health_stats and energy_stats
str2 = GetStringBetween(Str1, "<td>(", "/")
'Str2 Should now contain our players hp
If IsNumeric(str2) = True Then
'Check if str2 contains a number
Extract_health = str2 'returns the string of the function
Else
If InStr(strhtml, "Dead!") Then
Extract_health = 0
Else
Extract_health = -1
End If
'Returns -1 to our function
End If
End Function
Function Extract_Energy() As String
'Returns player health from html source
'Html:
' <tr id='energy_stats'>
' <td>Energy: </td>
' <td><div class='meter' style='width: 90px;'><div class='meter_left'></div><div class='meter_fill blue' style='width: 84px;'></div><div class='meter_right'></div></div></td>
' <td>(100/100)</td>
' </tr>
' </table>
' <div id='action_timer'>
Str1 = GetStringBetween(strhtml, "energy_stats", "action_timer")
'Str1 now contains all the html between energy_stats and action_timer
str2 = GetStringBetween(Str1, "<td>(", "/")
'Str2 Should now contain our players Energy
If IsNumeric(str2) = True Then
'Check if str2 contains a number
Extract_Energy = str2 'returns the string of the function
Else
Extract_Energy = -1
'Returns -1 to our function
End If
End Function
Function Extract_Team() As String
'Returns player health from html source
'Html:
' <tr id='energy_stats'>
' <td>Energy: </td>
' <td><div class='meter' style='width: 90px;'><div class='meter_left'></div><div class='meter_fill blue' style='width: 84px;'></div><div class='meter_right'></div></div></td>
' <td>(100/100)</td>
' </tr>
' </table>
' <div id='action_timer'>
Str1 = GetStringBetween(strhtml, "stat_team_and_level'>", " - ")
Extract_Team = Str1 'returns the string of the function
End Function
Public Function GetHealUrl() As String
'Checks if a player in the current page html needs healing
'Info:
'Human - Health: 22 / 100
'The above text only shows if a person needs healing we will use this
' <!-- End showing current player -->
'The above text shows in the html source code after our own players stats
'have shown
strstart = InStr(strhtml, "End showing current player")
'Strstart should now hold the location in our html at the
'end of our own players stats
If strstart < 1 Then
'If the above code is not in html then something is wrong return -1 and exit the
'function so we can handle it without a error box
GetHealUrl = "-1"
Exit Function
End If
If InStr(strstart, strhtml, "Health: ") > 0 Then
'Looks for our "Health: " in our html string starts looking after our own stats
html1 = GetStringBetween(strhtml, "Health: ", "/", strstart)
'Extract Players Health
'FrmMain.LstLog.AddItem (Time() & " Found player with " & html1 & " Health.")
'Add to log
temp = GetStringBetween(strhtml, "a href='", "' class", strstart)
If temp <> "" Then
GetHealUrl = "http://www.gaiaonline.com" & temp
Exit Function
End If
End If
'If we got here a error occured
GetHealUrl = "-1"
End Function
Public Function GetSelfUrl() As String
strhtml = FrmMain.wrapper.GetWrapper("http://www.gaiaonline.com/forum/f.459", FrmMain.wrapper.LastPage)
html1 = GetStringBetween(strhtml, "current player", "showing current ")
temp = GetStringBetween(html1, "a href='", "' class")
GetSelfUrl = "http://www.gaiaonline.com" & temp
End Function
Public Function HealSelf()
DoHealSpellSelf
Game_UpdateStats
End Function
Public Function DoHealSpellSelf()
Dim healurl As String
healurl = GetSelfUrl
strhtml = FrmMain.wrapper.GetWrapper(healurl, FrmMain.wrapper.LastPage)
'Start Elves
If InStr(strhtml, ">Fizzy Potion</label>") > 0 Then
strhtml = FrmMain.wrapper.GetWrapper(healurl & "&do=choose&ability_id=128", FrmMain.wrapper.LastPage)
If InStr(strhtml, "You can act again in") Then
FrmMain.LstLog.AddItem (Time() & " Healed self using Fizzy Potion")
Game_UpdateStats
Exit Function
End If
End If
If InStr(strhtml, ">Healing Potion</label>") > 0 Then
strhtml = FrmMain.wrapper.GetWrapper(healurl & "&do=choose&ability_id=120", FrmMain.wrapper.LastPage)
If InStr(strhtml, "You can act again in") Then
FrmMain.LstLog.AddItem (Time() & " Healed self using Healing Potion")
Game_UpdateStats
Exit Function
End If
End If
'Start Human
If InStr(strhtml, ">Turkey Dinner</label>") > 0 Then
strhtml = FrmMain.wrapper.GetWrapper(healurl & "&do=choose&ability_id=32", FrmMain.wrapper.LastPage)
If InStr(strhtml, "You can act again in") Then
FrmMain.LstLog.AddItem (Time() & " Healed self using Turkey Dinner")
Game_UpdateStats
Exit Function
End If
End If
If InStr(strhtml, ">Effing Good Ham Sandwich</label>") > 0 Then
strhtml = FrmMain.wrapper.GetWrapper(FrmMain.wrapper.LastPage & "&do=choose&ability_id=14", FrmMain.wrapper.LastPage)
If InStr(strhtml, "You can act again in") Then
FrmMain.LstLog.AddItem (Time() & " Healed self using Effing Good Ham Sandwich")
Game_UpdateStats
Exit Function
End If
End If
If InStr(strhtml, ">Sandwich</label>") > 0 Then
strhtml = FrmMain.wrapper.GetWrapper(healurl & "&do=choose&ability_id=8", FrmMain.wrapper.LastPage)
If InStr(strhtml, "You can act again in") Then
FrmMain.LstLog.AddItem (Time() & " Healed self player using Sandwich")
Game_UpdateStats
Exit Function
End If
End If
If InStr(strhtml, ">Reanimate</label>") > 0 And GameHealth = 0 Then
strhtml = FrmMain.wrapper.GetWrapper(healurl & "&do=choose&ability_id=80", FrmMain.wrapper.LastPage)
If InStr(strhtml, "You can act again in") Then
FrmMain.LstLog.AddItem (Time() & " Healed Self using Reanimate")
Game_UpdateStats
Exit Function
End If
End If
End Function
Public Function HealPlayer()
Dim healurl As String
healurl = GetHealUrl
strhtml = FrmMain.wrapper.GetWrapper(healurl, FrmMain.wrapper.LastPage)
'Elves
If InStr(strhtml, ">Fizzy Potion</label>") > 0 Then
strhtml = FrmMain.wrapper.GetWrapper(healurl & "&do=choose&ability_id=128", FrmMain.wrapper.LastPage)
If InStr(strhtml, "You can act again in") Then
FrmMain.LstLog.AddItem (Time() & " Healed player using Fizzy Potion")
Game_UpdateStats
Exit Function
End If
End If
If InStr(strhtml, ">Healing Potion</label>") > 0 Then
strhtml = FrmMain.wrapper.GetWrapper(healurl & "&do=choose&ability_id=120", FrmMain.wrapper.LastPage)
If InStr(strhtml, "You can act again in") Then
FrmMain.LstLog.AddItem (Time() & " Healed player using Healing Potion")
Game_UpdateStats
Exit Function
End If
End If
'Humans
If InStr(strhtml, ">Turkey Dinner</label>") > 0 Then
strhtml = FrmMain.wrapper.GetWrapper(healurl & "&do=choose&ability_id=32", FrmMain.wrapper.LastPage)
If InStr(strhtml, "You can act again in") Then
FrmMain.LstLog.AddItem (Time() & " Healed player using Turkey Dinner")
Game_UpdateStats
Exit Function
End If
End If
If InStr(strhtml, ">Effing Good Ham Sandwich</label>") > 0 Then
strhtml = FrmMain.wrapper.GetWrapper(FrmMain.wrapper.LastPage & "&do=choose&ability_id=14", FrmMain.wrapper.LastPage)
If InStr(strhtml, "You can act again in") Then
FrmMain.LstLog.AddItem (Time() & " Healed player using Effing Good Ham Sandwich")
Game_UpdateStats
Exit Function
End If
End If
If InStr(strhtml, ">Sandwich</label>") > 0 Then
strhtml = FrmMain.wrapper.GetWrapper(healurl & "&do=choose&ability_id=8", FrmMain.wrapper.LastPage)
If InStr(strhtml, "You can act again in") Then
FrmMain.LstLog.AddItem (Time() & " Healed player using Sandwich")
Game_UpdateStats
Exit Function
End If
End If
'Dark Elves
'If InStr(strhtml, ">Reanimate</label>") > 0 Then
'strhtml = FrmMain.wrapper.GetWrapper(healurl & "&do=choose&ability_id=80", FrmMain.wrapper.LastPage)
'If InStr(strhtml, "You can act again in") Then
'FrmMain.LstLog.AddItem (Time() & " Healed player using Reanimate")
'Game_UpdateStats
'Exit Function
'End If
'End If
End Function
Public Function checknewgame()
'Checks if player has not yet joined the event
'Joins Humans if not
strhtml = FrmMain.wrapper.GetWrapper("http://www.gaiaonline.com/event/halloween2008/", FrmMain.wrapper.LastPage)
If InStr(strhtml, "Welcome to Halloween Hysteria!") > 1 Then
FrmMain.LstLog.AddItem (Time() & " Not yet joined event so joining now...")
ChangeTeam ("humans")
End If
End Function
Public Function checkmaxlevel()
'Checks if player as reached max level for current faction
If InStr(strhtml, "MAX LEVEL!") > 0 Then
ChangeTeam 'Change to next available team
End If
End Function
Public Function ChangeTeam(Optional ToTeamType As String)
'Gets the change faction url from the choose team page html
'If ToTeamType is not set , looks for next available faction
Dim changeurl As String
Select Case ToTeamType
Case "humans"
strhtml = FrmMain.wrapper.GetWrapper("http://www.gaiaonline.com/event/halloween2008/chooseteam", FrmMain.wrapper.LastPage)
changeurl = geturl("Human")
strhtml = FrmMain.wrapper.GetWrapper(changeurl, FrmMain.wrapper.LastPage)
FrmMain.LstLog.AddItem (Time() & " Joined event as a human")
Exit Function
End Select 'You could add other code here i didnt need it
FrmMain.LstLog.AddItem (Time() & " Max level reached attempting to change faction...")
currentfaction = Extract_Team
Dim Factions(0 To 3) As String 'Build an array of the factions
Factions(0) = "Human"
Factions(1) = "Zombie"
Factions(2) = "Dark Elf"
Factions(3) = "Vampire"
'Detect all 100% completed factions
'Select next faction until one is not completed
'If all are completed then tell the user that we have finished botting
For i = 0 To UBound(Factions)
If Factions(i) <> currentfaction Then 'We dont need to check our current faction we already know we have completed this level
strhtml1 = GetStringBetween(strhtml, "<td>" & Factions(i) & ":", "meter_right")
factionpercent = GetStringBetween(strhtml1, "green' style='width: ", "px")
If factionpercent <> 104 Then
geturl (Factions(i))
changeurl = geturl(Factions(i))
If changeurl = "" Then GoTo done
strhtml = FrmMain.wrapper.GetWrapper(changeurl, FrmMain.wrapper.LastPage)
FrmMain.LstLog.AddItem (Time() & " Changed faction to " & Factions(i))
Exit Function
End If
End If
Next i
done:
'Bot completed all levels
MsgBox ("The bot has finished leveling all of your factions and has stopped")
End Function
Function geturl(faction As String)
'Gets the change faction url including the random string on the end
strhtml = FrmMain.wrapper.GetWrapper("http://www.gaiaonline.com/event/halloween2008/chooseteam", FrmMain.wrapper.LastPage)
Select Case faction
Case "Human"
geturl1 = GetStringBetween(strhtml, "&team=1&n=", "'")
geturl = "http://avatarsave.gaiaonline.com/event/halloween2008/chooseteam?do=choose&team=1&n=" & geturl1
Case "Vampire"
geturl1 = GetStringBetween(strhtml, "&team=2&n=", "'")
geturl = "http://avatarsave.gaiaonline.com/event/halloween2008/chooseteam?do=choose&team=2&n=" & geturl1
Case "Zombie"
geturl1 = GetStringBetween(strhtml, "&team=3&n=", "'")
geturl = "http://avatarsave.gaiaonline.com/event/halloween2008/chooseteam?do=choose&team=3&n=" & geturl1
Case "Dark Elf"
geturl1 = GetStringBetween(strhtml, "&team=4&n=", "'")
geturl = "http://avatarsave.gaiaonline.com/event/halloween2008/chooseteam?do=choose&team=4&n=" & geturl1
End Select
End Function
Public Function CheckMove()
'Checks if user needs to move to current location , if so then move there
Dim geturl1 As String
Dim gotourl As String
If InStr(strhtml, "/event/halloween2008/move?n=") Then
geturl1 = GetStringBetween(strhtml, "/event/halloween2008/move?n=", "Set")
geturl1 = "http://www.gaiaonline.com/event/halloween2008/move?n=" & geturl1
If geturl1 <> "" Then
geturl1 = Mid(geturl1, 1, Len(geturl1) - 2)
strhtml = FrmMain.wrapper.GetWrapper(geturl1, FrmMain.wrapper.LastPage)
gotourl = GetStringBetween(strhtml, "/event/halloween2008/move?do=confirm&forum_id=459&n=", "'")
gotourl = "http://www.gaiaonline.com/event/halloween2008/move?do=confirm&forum_id=459&n=" & gotourl
strhtml = FrmMain.wrapper.GetWrapper(gotourl, FrmMain.wrapper.LastPage)
FrmMain.html.Text = strhtml
FrmMain.LstLog.AddItem (Time() & " Changed location")
End If
End If
End Function | |
| |  |
10-26-2008, 10:21 AM
|
#2 (permalink)
| Banned
Join Date: Feb 2008 Posts: 2,646
GPoints: 1,626 Rep Power: 0 | Good release. It is pretty messy though. | |
| |
10-26-2008, 05:58 PM
|
#3 (permalink)
| Banned
Join Date: Jul 2007 Posts: 228
GPoints: 1,713 Rep Power: 0 | Yeah ill release a program that will hopefully help with it:
Ill do it open source just need code for vampires and its done 
Last edited by raredaredevil; 10-26-2008 at 06:00 PM..
| |
| |
10-28-2008, 02:32 PM
|
#4 (permalink)
| Banned
Join Date: Oct 2008 Posts: 36
GPoints: 231 Rep Power: 0 | Great job. Once you finish that open source program. It will be amazing. LOL
But, may i ask you to work on an open-source bot for zOMG!? | |
| |
10-28-2008, 02:49 PM
|
#5 (permalink)
| Banned
Join Date: Feb 2008 Posts: 2,646
GPoints: 1,626 Rep Power: 0 | Quote:
Originally Posted by DjMaddius Great job. Once you finish that open source program. It will be amazing. LOL
But, may i ask you to work on an open-source bot for zOMG!? | You should work on your own. It's rude to ask him to release one if you already know how to program. Assuming, since you just created a Halloween bot. Maybe using his source, I don't even know. | |
| |
10-28-2008, 03:22 PM
|
#6 (permalink)
| Banned
Join Date: Oct 2008 Posts: 36
GPoints: 231 Rep Power: 0 | I created a trick or treating bot. And i asked because i dunno how to decrypt .swf files. Read them, or even download them off of gaia. Or trust me, i would be working on it right now. | |
| |
10-28-2008, 04:10 PM
|
#7 (permalink)
| Banned
Join Date: Feb 2008 Posts: 2,646
GPoints: 1,626 Rep Power: 0 | Quote:
Originally Posted by DjMaddius I created a trick or treating bot. And i asked because i dunno how to decrypt .swf files. Read them, or even download them off of gaia. Or trust me, i would be working on it right now. | Decrypting it is not necessary.
First, you must begin with receiving the .swf files. After recievng them, download them by doing: File > Save Page As, anything. Once you save it, make sure you have Sothink SWF Decompiler. Then, open the swf file you just downloaded from Gaia, and look and the action source, taking out variables and maniupulating them.
I might create a full guide of how to do this in, VB.NET or VB6. | |
| |
10-28-2008, 04:29 PM
|
#8 (permalink)
| Banned
Join Date: Oct 2008 Posts: 36
GPoints: 231 Rep Power: 0 | Ok, well thanks. Ill see what i can do  *Goes and downloads the ware for sothink SWF decompiler*
EDIT:: How do i recieve the .swf files?
Last edited by DjMaddius; 10-28-2008 at 04:32 PM..
| |
| |
10-28-2008, 04:34 PM
|
#9 (permalink)
| Banned
Join Date: Feb 2008 Posts: 2,646
GPoints: 1,626 Rep Power: 0 | Quote:
Originally Posted by DjMaddius Ok, well thanks. Ill see what i can do  *Goes and downloads the ware for sothink SWF decompiler*
EDIT:: How do i recieve the .swf files? | By downloading Sothing SWF Catcher for Firefox. | |
| |
10-28-2008, 04:52 PM
|
#10 (permalink)
| Banned
Join Date: Oct 2008 Posts: 36
GPoints: 231 Rep Power: 0 | Ohh.. Now i have to download firefox too then. -.-
EDIT:: NVM, there is a version for IE too. | |
| |  | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Thread Tools | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | |