Moderator: MacroQuest Developers

Code: Select all
#Event Invited "#*#To join the group, click on the 'FOLLOW' option, or 'DISBAND' to cancel#*#"
Sub Main
:Loop
/doevents
/goto :Loop
/return
Sub Event_Invited
/invite
/return
Code: Select all
/delay ${Math.Calc[${Math.Rand[5]}+2]}sCode: Select all
#Event AcceptInvite "[MQ2] acceptinvite"
#Event Invited "#*#To join the group, click on the 'FOLLOW' option, or 'DISBAND' to cancel#*#"
Sub Event_Invited
/if (${acceptinvite}) {
/invite
/varcalc acceptinvite ${acceptinvite}-1
/echo accepted advite, you will now accept the following ${acceptinvite} invites
}
/return
Sub Event_AcceptInvite
/varcalc acceptinvite ${acceptinvite}+1
/echo you will now accept the following ${acceptinvite} invites
/return
Sub Main
/declare acceptinvite int global 0
/squelch /alias /acceptinvite /echo acceptinvite
:Loop
/doevents
/goto :Loop
/return
sub mainCode: Select all
#event HANDLE_INVITEME "<#1#> INVITEME"
Sub Event_HANDLE_INVITEME(string Line, string Sender)
|This function creates groups or forms raids with all the bots
/if (!${Ini[INI_FILE, BotNet, ${Sender}, NOT_FOUND]}) {
/i msg IRC_CHANNEL # IGNORING REQUEST!
/return
}
/if (!${Group.Members} && ${Spawn[pc ${Sender}].ID}) {
/i msg IRC_CHANNEL # Forming group with ${Sender} in ${Zone.ShortName}
/target pc ${Sender}
/invite
} else {
|This code invites player to group or to raid if group is full. If raid is created, it
|lets another group leader do the invite
|Am I group leader? ${Me.AmIGroupLeader} is broken
/if ((${Group.Leader.ID} == ${Me.ID}) && ${Spawn[pc ${Sender}].ID}) {
/if (${Group.Members} < 5) {
/i msg IRC_CHANNEL # Inviting ${Sender} to group in ${Zone.ShortName}
/target pc ${Sender}
/invite
} else {
/if (!${Raid.Members}) {
/i msg IRC_CHANNEL # Inviting ${Sender} to raid in ${Zone.ShortName}
/target pc ${Sender}
/raidinvite
} else {
/echo # Debug: My group is full and I am in raid, let next group leader handle invite.
}
}
} else {
|/echo # Debug: Can't form group with ${Sender}-im not leader/player not in zone
}
}
/returnCode: Select all
#event HANDLE_INVITED "#1# invites you to join a group."
Sub Event_HANDLE_INVITED(string Line, string Player)
|This function creates groups or forms raids with all the bots
/if (!${Ini[INI_FILE, BotNet, ${Player}, NOT_FOUND]}) {
/i msg IRC_CHANNEL # IGNORING GROUP INVITE FROM ${Player}
/return
}
/if (!${Group.Members}) {
/i msg IRC_CHANNEL # Accepted group invite from ${Player}
/delay ${Math.Calc[${Math.Rand[5]}+2]}s
/invite
} else {
/i msg IRC_CHANNEL # Warning: I was invited by ${Player} but am already in group
}
/return
#event HANDLE_INVITEDRAID "#1# invites you to join a raid."
Sub Event_HANDLE_INVITEDRAID(string Line, string Player)
|This function creates groups or forms raids with all the bots
/if (!${Ini[INI_FILE, BotNet, ${Player}, NOT_FOUND]}) {
/i msg IRC_CHANNEL # IGNORING RAID INVITE FROM ${Player}
/return
}
/if (!${Raid.Members}) {
/i msg IRC_CHANNEL # Accepted raid invite from ${Player}
/delay ${Math.Calc[${Math.Rand[5]}+2]}s
/raidaccept
} else {
/i msg IRC_CHANNEL # Warning: I was invited to raid by ${Player} but am already in raid
}
/returnie so wouldnt need to run it every time.#Event AcceptInvite "[MQ2] acceptinvite"
#Event Invited "#*#To join the group, click on the 'FOLLOW' option, or 'DISBAND' to cancel#*#"
Sub Event_Invited
/if (${acceptinvite}) {
/invite
/varcalc acceptinvite ${acceptinvite}-1
/echo accepted advite, you will now accept the following ${acceptinvite} invites
}
/return
Sub Event_AcceptInvite
/varcalc acceptinvite ${acceptinvite}+1
/echo you will now accept the following ${acceptinvite} invites
/return
Sub Main
/declare acceptinvite int global 0
/squelch /alias /acceptinvite /echo acceptinvite
:Loop
/doevents
/goto :Loop
/return
sub main