Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Gaiaonline Christmas Caroling [2011]


  • Please log in to reply
No replies to this topic
jpjazzy
  • Members
  • 800 posts
  • Last active: Dec 17 2014 07:22 AM
  • Joined: 16 Feb 2010
For those of you who are gaiaonline fans, I assume you get annoyed with the process of caroling and whatnot. This script is something I wrote for my girlfriend fairly quickly so she could sleep and still get her objectives for caroling done. I know it is in no way a great script, but it gets the job done and should be fairly universal on whatever computer you use (That was my goal anyway because we have more than one).

Here is the hack job script which carols for you on gaiaonline, then hunts down Santa, clicks him and the arrows, then goes back to caroling:

#SingleInstance, Force
SetBatchLines, -1

ShopURLList = ; List the shops to carol at
(
http://www.gaiaonline.com/gaia/shopping.php?tps=all;1;datedesc
http://www.gaiaonline.com/gaia/shopping.php?tps=all;1;datedesc
http://www.gaiaonline.com/gaia/shopping.php?tps=all;1;datedesc
http://www.gaiaonline.com/gaia/shopping.php?tps=all;1;datedesc
http://www.gaiaonline.com/gaia/shopping.php?tps=all;1;datedesc
http://www.gaiaonline.com/gaia/shopping.php?tps=all;1;datedesc
http://www.gaiaonline.com/gaia/shopping.php?tps=all;1;datedesc
http://www.gaiaonline.com/gaia/shopping.php?tps=all;1;datedesc
http://www.gaiaonline.com/gaia/shopping.php?tps=all;1;datedesc
http://www.gaiaonline.com/gaia/shopping.php?tps=all;1;datedesc
http://www.gaiaonline.com/gaia/shopping.php?tps=all;1;datedesc
http://www.gaiaonline.com/gaia/shopping.php?tps=hair;1;datedesc
http://www.gaiaonline.com/gaia/shopping.php?tps=all;1;datedesc
http://www.gaiaonline.com/gaia/shopping.php?tps=color;1;datedesc
http://www.gaiaonline.com/gaia/shopping.php?tps=all;1;datedesc
http://www.gaiaonline.com/gaia/shopping.php?tps=all;1;datedesc
http://www.gaiaonline.com/gaia/shopping.php?tps=all;1;datedesc
http://www.gaiaonline.com/gaia/shopping.php?tps=all;1;datedesc
http://www.gaiaonline.com/gaia/shopping.php?tps=all;1;datedesc
http://www.gaiaonline.com/gaia/shopping.php?tps=all;1;datedesc
http://www.gaiaonline.com/gaia/shopping.php?tps=all;1;datedesc
)

MapURLList = ; list of the locations santa could be
(
http://www.gaiaonline.com/worldmap/?m=1
http://www.gaiaonline.com/worldmap/?m=2
http://www.gaiaonline.com/worldmap/?m=3
http://www.gaiaonline.com/worldmap/?m=4
http://www.gaiaonline.com/worldmap/?m=5
http://www.gaiaonline.com/worldmap/?m=6
http://www.gaiaonline.com/worldmap/?m=7
http://www.gaiaonline.com/worldmap/?m=8
http://www.gaiaonline.com/worldmap/?m=9
http://www.gaiaonline.com/worldmap/?m=10
http://www.gaiaonline.com/worldmap/?m=15
http://www.gaiaonline.com/worldmap/?m=16
http://www.gaiaonline.com/worldmap/?m=17
http://www.gaiaonline.com/worldmap/?m=18
http://www.gaiaonline.com/worldmap/?m=19
http://www.gaiaonline.com/worldmap/?m=21
http://www.gaiaonline.com/worldmap/?m=20
http://www.gaiaonline.com/worldmap/?m=22
http://www.gaiaonline.com/worldmap/?m=23
http://www.gaiaonline.com/worldmap/?m=24
http://www.gaiaonline.com/worldmap/?m=25
)

Traytip, Gaia Bot:, Bot running. Hit the Pause/Break key to start or stop the bot.

F2::
CarolCount := 19
return

Pause::
T := !T
If (T)
{
	Traytip, Gaia Bot:, Bot activated. Please do not use the computer.
	SetTimer, GBotCheck, 100
}
else
{
	Traytip, Gaia Bot:, Bot deactivated. Hit the Pause/Break key to start again.
	SetTimer, GBotCheck, Off
}
return

GBotCheck:
If (!LastCarolTime)
{
	LastCarolTime := A_TickCount ; Run first URL and set the time
	Run, http://www.gaiaonline.com/gaia/shopping.php?tps=all;1;datedesc
	Sleep, 5000
	SendInput, ^w ; Closes tab
	CarolCount++ 
	TrayTip, Gaia Bot:, Carol count - %CarolCount%
	Menu, Tray, Tip, Carol count - %CarolCount%
	Random, RandomWait, 60000, 70000 ; Random number between 60k and 70k milliseconds = 1 minutes - 1 minute and 10 seconds 
	
}
else
{
	If (CarolCount < 19 && A_TickCount-LastCarolTime > RandomWait) ; conditions of caroling
	{
		CarolCount++ ; Adds one to the carol count
		Loop, Parse, ShopURLList, `n, `r ; Runs link
		{
			If (A_Index = CarolCount)
			{
				Run, %A_LoopField%
				Sleep, 5000
				SendInput, ^w
				TrayTip, Gaia Bot:, Carol count - %CarolCount%
				Menu, Tray, Tip, Carol count - %CarolCount%
			}
			
		}
		LastCarolTime := A_TickCount ; Reset carol time
		Random, RandomWait, 60000, 70000 ; Random number between 60k and 70k milliseconds = 1 minutes - 1 minute and 10 seconds ('humane' addition to the bot)
	}
	Else if (CarolCount >= 19) ; Hunt for santa if the count is sufficent
	{
		TrayTip, Gaia Bot:, Hunting for Santa
		Menu, Tray, Tip, Hunting for Santa
		CoordMode, Tooltip ; Screen mode for the search and clicking the mouse
		CoordMode, Pixel
		CoordMode, Mouse
		Random, PA1, 1, 5 ; Number of pixels offset for the picture when clicking ('humane' addition to the bot)
		Random, PA2, 1, 5 ; ('humane' addition to the bot)
		Loop, Parse, MapURLList, `n, `r
		{
			Run, %A_Loopfield%
			Sleep, 5000 ; Load time
			Loop, 15 ; Loop to scroll down before checking screen
			{
				SendInput, {WheelDown}
				Sleep, 200
				ImageSearch, SantaX, SantaY, 0, 0, A_ScreenWidth, A_ScreenHeight, Santa.bmp
				If (!ErrorLevel) ; Santa was found!
				{
					MouseClick, Left, SantaX+PA1, SantaY+PA2
					Sleep, 2000 ; Load time
					While (!ErrorLevel)
					{
					ImageSearch, ArrowX, ArrowY, 0, 0, A_ScreenWidth, A_ScreenHeight, Arrows.bmp
						If (!ErrorLevel) ; click the arrows
						{
						MouseClick, Left, ArrowX+PA1, ArrowY+PA2
						}
					}
					LastCarolTime := CarolCount := ""
					CoordMode, Tooltip, Relative
					CoordMode, Pixel, Relative 
					CoordMode, Mouse, Relative
					SendInput, ^w
					return
				}
			}
			SendInput, ^w
		}
	}
}
return

Esc::ExitApp ; Exits the application

Notes:

[*:1jnyepp4] You need a small 24-bit .bmp file of Santa named Santa.bmp and the same format for the a small section of the arrows you click on to scroll through his text called Arrows.bmp. These should both be located in the same directory as the script. [Note that you cannot have any background on Santa's picture as he can hide on different pieces of the map and you want the smallest amount possible on the arrows!]
[*:1jnyepp4] Hit the Pause/Break button to toggle the bot being active.
[*:1jnyepp4] You will not be able to use your computer while this is going (unless it is ran on a virtual machine) because it uses an image search to hunt for Santa.
[*:1jnyepp4] The delay between carols is random between 60 and 70 seconds to generate a more humane appearance.
[*:1jnyepp4] The offset the mouse is clicked at on Santa and his arrows are randomly generated also, between 1 and 5 pixels.
[*:1jnyepp4] The delay before closing the tab is 5 seconds. Adjust it if needed.
[*:1jnyepp4] This uses ctrl + w to close a tab. If that doesn't work in your browser for some reason, change it.
Enjoy, and Merry Christmas.
AutoHotkey Basic - Windows 7
Posted Image