;Druid Port Bot v1.2 1.17.08
;Gp1001
;Credits
;Original author Syliac
;Cybertech for the help on authorized_users
;Pygar for helping me with ChoiceWindows.
variable set authorized_users
;For saving settings to a file in the future.
;variable filepath mainpath="${LavishScript.HomeDirectory}/Scripts/"
function initPortBot()
{
ext -require isxeq2
wait 200 ${ISXEQ2.IsReady}
if !${ISXEQ2.IsReady}
{
echo ISXEQ2 failed to load, bailing out
return ERROR
}
Event[EQ2_onChoiceWindowAppeared]:AttachAtom[EQ2_onChoiceWindowAppeared]
authorized_users:Add[Player1]
authorized_users:Add[Player2]
declare FollowMode bool script 0
declare triggerCheckTimer int script 1
call Clear_Triggers
AddTrigger QueueCommonlands "\\aPC @*@ @*@:@sender@\\/a tells@*@Commonlands@*@"
AddTrigger QueueAntonica "\\aPC @*@ @*@:@sender@\\/a tells@*@Antonica@*@"
AddTrigger QueueButcherBlock "\\aPC @*@ @*@:@sender@\\/a tells@*@ButcherBlock@*@"
AddTrigger QueueGfay "\\aPC @*@ @*@:@sender@\\/a tells@*@Gfay@*@"
AddTrigger QueueSteamfont "\\aPC @*@ @*@:@sender@\\/a tells@*@Steamfont@*@"
AddTrigger QueueKunzar "\\aPC @*@ @*@:@sender@\\/a tells@*@Kunzar@*@"
AddTrigger QueueKylong "\\aPC @*@ @*@:@sender@\\/a tells@*@Kylong@*@"
AddTrigger QueueDisband "\\aPC @*@ @*@:@sender@\\/a tells@*@Disband Group@*@"
}
atom(script) EQ2_onChoiceWindowAppeared()
{
if ${ChoiceWindow.Text.Find[${sender}]} && ${authorized_users.Contains[${sender}]}
{
echo ${sender}
ChoiceWindow:DoChoice1
return
}
else
{
echo ${sender}
ChoiceWindow:DoChoice2
return
}
}
function main(int Follow)
{
EQ2Echo Initializing Druid Port Bot!
call initPortBot
FollowMode:Set[${Follow}]
do
{
;waitframe
call Check_Triggers
}
while 1
}
function QueueDisband(string Line, string sender)
{
if ${sender(exists)} && ${authorized_users.Contains[${sender}]}
{
EQ2Execute "/tell ${sender} Disbanding group!"
call CastPort DisbandGroup
}
else
EQ2echo Unauthorized Attemp!
}
function QueueCommonlands(string Line, string sender)
{
if ${sender(exists)} && ${authorized_users.Contains[${sender}]}
{
if !${Me.Ability[Circle of Commonlands].IsReady}
{
EQ2Execute "/tell ${sender} Circle of Commonlands is not ready yet!"
}
else
EQ2Execute "/tell ${sender} Incoming port to Commonlands!"
call CastPort Commonlands
}
else
EQ2echo Unauthorized Attemp!
}
function QueueAntonica(string Line, string sender)
{
if ${sender(exists)} && ${authorized_users.Contains[${sender}]}
{
if !${Me.Ability[Circle of Antonica].IsReady}
{
EQ2Execute "/tell ${sender} Circle of Antonica is not ready yet!"
}
else
EQ2Execute "/tell ${sender} Incoming port to Antonica!"
call CastPort Antonica
}
else
EQ2echo Unauthorized Attemp!
}
function QueueButcherBlock(string Line, string sender)
{
if ${sender(exists)} && ${authorized_users.Contains[${sender}]}
{
if !${Me.Ability[Circle of ButcherBlock].IsReady}
{
EQ2Execute "/tell ${sender} Circle of ButcherBlock is not ready yet!"
}
else
EQ2Execute "/tell ${sender} Incoming port to Butcher Block!"
call CastPort ButcherBlock
}
else
EQ2echo Unauthorized Attemp!
}
function QueueGfay(string Line, string sender)
{
if ${sender(exists)} && ${authorized_users.Contains[${sender}]}
{
if !${Me.Ability[Circle of Greater Faydark].IsReady}
{
EQ2Execute "/tell ${sender} Circle of Greater Faydark is not ready yet!"
}
else
EQ2Execute "/tell ${sender} Incoming port to Greater Faydark!"
call CastPort Gfay
}
else
EQ2echo Unauthorized Attemp!
}
function QueueSteamfont(string Line, string sender)
{
if ${sender(exists)} && ${authorized_users.Contains[${sender}]}
{
if !${Me.Ability[Circle of Steamfont].IsReady}
{
EQ2Execute "/tell ${sender} Circle of Steamfont is not ready yet!"
}
else
EQ2Execute "/tell ${sender} Incoming port to Steamfont!"
call CastPort Steamfont
}
else
EQ2echo Unauthorized Attemp!
}
function QueueKunzar(string Line, string sender)
{
if ${sender(exists)} && ${authorized_users.Contains[${sender}]}
{
if !${Me.Ability[Circle of Kunzar Jungle].IsReady}
{
EQ2Execute "/tell ${sender} Circle of Kunzar Jungle is not ready yet!"
}
else
EQ2Execute "/tell ${sender} Incoming port to Kunzar Jungle!"
call CastPort Kunzar
}
else
EQ2echo Unauthorized Attemp!
}
function QueueKylong(string Line, string sender)
{
if ${sender(exists)} && ${authorized_users.Contains[${sender}]}
{
if !${Me.Ability[Circle of Kylong Plains].IsReady}
{
EQ2Execute "/tell ${sender} Circle of Kylong Plains is not ready yet!"
}
else
EQ2Execute "/tell ${sender} Incoming port to Kylong Plains!"
call CastPort Kylong
}
else
EQ2echo Unauthorized Attemp!
}
function CastPort(string destination)
{
switch ${destination}
{
case DisbandGroup
EQ2Execute /disband
break
case Commonlands
Me.Ability[Circle of Commonlands]:Use
break
case Antonica
Me.Ability[Circle of Antonica]:Use
break
case ButcherBlock
Me.Ability[Circle of ButcherBlock]:Use
break
case Gfay
Me.Ability[Circle of Greater Faydark]:Use
break
case Steamfont
Me.Ability[Circle of Steamfont]:Use
break
case Kunzar
Me.Ability[Circle of Kunzar Jungle]:Use
break
case Kylong
Me.Ability[Circle of Kylong Plains]:Use
break
case default
Eq2echo ERROR!
break
}
if ${FollowMode}
{
call ClickZone ${destination}
}
}
function ClickZone(string destination)
{
wait 200
switch ${destination}
{
case DisbandGroup
EQ2echo Disbanding from Group
break
case Commonlands
Actor[portal_to_commonlands]:DoubleClick
wait 10
EQ2UIPage[popup,ZoneTeleporter].Child[list,Destinations.DestinationList]:HighlightRow[2]
EQ2:ConfirmZoneTeleporterDestination
if ${EQ2.Zoning}
{
; Ok EQ2 is zoning.
do
{
wait 20
if !${EQ2.Zoning}
; EQ2 is now zoned...
break
}
while 1>0
break
}
break
case Antonica
Actor[portal_to_antonica]:DoubleClick
wait 10
EQ2UIPage[popup,ZoneTeleporter].Child[list,Destinations.DestinationList]:HighlightRow[2]
EQ2:ConfirmZoneTeleporterDestination
if ${EQ2.Zoning}
{
; Ok EQ2 is zoning.
do
{
wait 20
if !${EQ2.Zoning}
; EQ2 is now zoned...
break
}
while 1>0
break
}
break
case ButcherBlock
Actor[portal_to_butcherblock]:DoubleClick
wait 10
EQ2UIPage[popup,ZoneTeleporter].Child[list,Destinations.DestinationList]:HighlightRow[2]
EQ2:ConfirmZoneTeleporterDestination
if ${EQ2.Zoning}
{
; Ok EQ2 is zoning.
do
{
wait 20
if !${EQ2.Zoning}
; EQ2 is now zoned...
break
}
while 1>0
break
}
break
case Gfay
Actor[portal_to_greater_fay]:DoubleClick
wait 10
EQ2UIPage[popup,ZoneTeleporter].Child[list,Destinations.DestinationList]:HighlightRow[2]
EQ2:ConfirmZoneTeleporterDestination
if ${EQ2.Zoning}
{
; Ok EQ2 is zoning.
do
{
wait 20
if !${EQ2.Zoning}
; EQ2 is now zoned...
break
}
while 1>0
break
}
break
case Steamfont
Actor[portal_to_steamfont]:DoubleClick
wait 10
EQ2UIPage[popup,ZoneTeleporter].Child[list,Destinations.DestinationList]:HighlightRow[2]
EQ2:ConfirmZoneTeleporterDestination
if ${EQ2.Zoning}
{
; Ok EQ2 is zoning.
do
{
wait 20
if !${EQ2.Zoning}
; EQ2 is now zoned...
break
}
while 1>0
break
}
break
case Kunzar
Actor[portal_to_kunzar_jungle]:DoubleClick
wait 10
EQ2UIPage[popup,ZoneTeleporter].Child[list,Destinations.DestinationList]:HighlightRow[2]
EQ2:ConfirmZoneTeleporterDestination
if ${EQ2.Zoning}
{
; Ok EQ2 is zoning.
do
{
wait 20
if !${EQ2.Zoning}
; EQ2 is now zoned...
break
}
while 1>0
break
}
break
case Kylong
Actor[portal_to_kylong_plains]:DoubleClick
wait 10
EQ2UIPage[popup,ZoneTeleporter].Child[list,Destinations.DestinationList]:HighlightRow[2]
EQ2:ConfirmZoneTeleporterDestination
if ${EQ2.Zoning}
{
; Ok EQ2 is zoning.
do
{
wait 20
if !${EQ2.Zoning}
; EQ2 is now zoned...
break
}
while 1>0
break
}
break
case default
Eq2echo ERROR!
break
}
}
; === Resets the triggers so we dont get spammed with tells ===
; === This should be run BEFORE adding any triggers! ===
; ================================================================
function Clear_Triggers()
{
FlushQueued
}
; ================================================================
; === This function will check any queued events. This can ===
; === can maximum be activated so often as the given var in ===
; === Initialize() ===
; ================================================================
function Check_Triggers()
{
If ${Math.Calc[${Time.Timestamp}-${triggerTime.Timestamp}]} >=${triggerCheckTimer}
{
if ${QueuedCommands}
{
do
{
ExecuteQueued
}
while ${QueuedCommands}
}
triggerTime:Set[${Time.Timestamp}]
}
}
; ================================================================
; === Runs when script ends ===
; ================================================================
function atexit()
{
Event[EQ2_onChoiceWindowAppeared]:DetachAtom[EQ2_onChoiceWindowAppeared]
EQ2Echo Druid Port Bot is now exiting!
}