Autocamp script for auto timed logout

morgur

Active Member
I saw a few requests for this type of script so I'm sharing this basic one that I put together for the community. Feel free to improve upon it.

This will camp out your toon out after a specified period of time. It just does a basic timer countdown and then logs out, but it does a few checks first to make sure that you aren't in combat, casting or moving before it attempts to camp. It will also recover and continue to camp if you get interrupted while attempting to camp. It should probably work fine with eq2bot as well.

There are a few options such as setting the type of logout that you want (camp to desktop/exit/select/etc) that you can set which are in bold below:

Code:
;Autocamp.iss script by Morgur
;Usage - 'run autocamp x'  where 'x' is the amount of time to wait before logging out.
;1 = 1 hour (60 minutes), .5 = half hour, 1.5 = hour and a half. Decimal values are supported ie. 1.8, 4.3, 1.5, .3, .5, etc..
;Example:  'run autocamp 2.5'  will autolog the character out after two and a half hours
;The default is 1 hour if no time is specified or 0 is specified. 
;For example 'run autocamp' will automatically use a 1 hour logout timer. However, 0.1 (360 seconds/6 minutes), 0.001, etc..
;or decimal values less than a whole hour will work fine.

function main(float quittimehours)
{

declare quittime float local
declare starttime int local
declare timestamp int local
declare camptype int local
declare camptoon string local

[B];camptype 1 = desktop   2 = exit   3 = login/select (default)   4 = camp over to specific toon
;camptoon - toon name to camp over to if camptype is set to 4

camptype:Set[3]
camptoon:Set["Yourtoonname"][/B]

if ${quittimehours} <= 0
{
quittimehours:Set[1]
}

quittime:Set[${Math.Calc[${quittimehours}*(60*60)]}]
starttime:Set[${Time.Timestamp}]
timestamp:Set[${Time.Timestamp}-${starttime}]


echo ***LOGOUT COUNTDOWN IS SET FOR ${quittimehours} HOURs***
echo STARTING COUNTERS: Logout Time = ${quittime} Seconds - Starting Stamp ${starttime} - Time Delta ${timestamp}

do
{
[B]    wait 3000
    ;checks the logout time every 5 minutes, change the wait from 3000 to lower if you want it to check more frequently[/B]
    
    timestamp:Set[${Time.Timestamp}-${starttime}]
    echo LOGOUT COUNTDOWN: Current Runtime is ${timestamp} seconds - Logout time set to ${quittime} seconds or ${quittimehours} hours
}
while ${timestamp} < ${quittime}

do
{
if ${timestamp} >= ${quittime}
{
	if ${Me.IsMoving} == TRUE || ${Me.CastingSpell} == TRUE || ${Me.InCombat} == TRUE
			{
			echo Cannot camp right now because you are - moving, casting or in combat...
			wait 100
			}
	else
{
echo The script run time ${timestamp} is greater than the Logout Timer ${quittime} ... 
		if ${camptype}==4
		{
		EQ2Execute /camp ${camptoon}
		echo ==Camping to ${camptoon}==
		}
		if ${camptype}==3
		{
		EQ2Execute /camp
		echo ==Camping to Character Select==
		}
		if ${camptype}==2
		{
		echo ==Exiting==
		EQ2Execute /exit
		}
		if ${camptype}==1
		{
		EQ2Execute /camp desktop
		echo ==Camping to Desktop==
		}
wait 250
if ${Me.InGameWorld}==FALSE
{
endscript autocamp
}
echo ************CAMPING INTERRUPTED!!!************
}
}
}
while 1
}
 

Attachments

Last edited:
Top Bottom