TheQQmaster
Trolling the Trolls
Posts: 1,532
Joined: Jun 2012
Reputation: 642
Version:
1.4.2.133
|
RE: help with multibox +tower scripts
my trash, edit on ur needs, lame old code
LUA Programming
--== ON PLUGIN CREATION SETTING DEFAULT VARIABLES ==--
function OnCreate()
TankingCheck = false; PickupCheck = false; AurasEnableCheck = false;PkListCheck = false;IssListCheck = false;HealerListCheck = false;DDsExecuteListCheck = false;ProfListCheck = false;AlarmCheck = false;BotEnableCheck = false;pkRessExecuteCheck = false;pkAssistExecuteCheck = false;pkTargetExecuteCheck = false;PickupCheck = false;SelfBuffsListCheck = false;WarAlarmListCheck = false;ScroolHB = false;IssOOP = false;PickupHerb = false;
AutoStartBot = true;
InvByPMtext = "exp"; -- DEFINE INVITATION PM
PickupHerbList = {""};--
ScroolHBList = {""};--
IssOOPList = {""};--
PkCharKillerList = {""};-- set names for pk killer char list to enable script
ProfList = {""}-- delete proof list who to enable that script
PT_MA_LIST = {""}-- all party ma list
PT_leader01 = "";-- pt 1 ma
PTMemberToInv01 = {""}-- pt 1 members to inv
PT_leader02 = "";
PTMemberToInv02 = {""}
PT_leader03 = "";
PTMemberToInv03 = {""}
PT_leader04 = "";
PTMemberToInv04 = {""}
PT_Small = "";
Small_PT = {""}
PT_PK_LEADER = "";
PTMemberToInvPK = {""}
pkRessExecuteLIST = {""}
pkAssistExecuteCheckLIST = {""}
pkTargetExecuteCheckLIST = {""}
WarAlarmList = {""}
this:RegisterCommand("r", CommandChatType.CHAT_ALLY, CommandAccessLevel.ACCESS_ME); -- RECORDING START
this:RegisterCommand("rs", CommandChatType.CHAT_ALLY, CommandAccessLevel.ACCESS_ME); -- RECORDING STOP
this:RegisterCommand("isave", CommandChatType.CHAT_ALLY, CommandAccessLevel.ACCESS_ME); -- SAVE CHAR CONFIG
this:RegisterCommand("iload", CommandChatType.CHAT_ALLY, CommandAccessLevel.ACCESS_ME); -- LOAD CHAR CONFIG
end;
--== ON PLUGIN CREATION SETTING DEFAULT VARIABLES ==--
function OnCommand_isave(vCommandChatType, vNick, vCommandParam) ProcessCommand("/save "..GetMe():GetName()) end;
function OnCommand_iload(vCommandChatType, vNick, vCommandParam) ProcessCommand("/load "..GetMe():GetName()) end;
function OnCommand_r(vCommandChatType, vNick, vCommandParam) ProcessCommand("/recstart arec-" .. os.date("%H-%M-%S")) end;
function OnCommand_rs(vCommandChatType, vNick, vCommandParam) ProcessCommand("/recstop") end;
--== SEARCH IN ARRAY FUNCTION ==--
function Search(user,list)
for x,b in pairs(list) do
if (user == b) then
return true;
end;
end;
end;
--== ENABLING/DISABLING FUNCTION ==--
function Shots(value)
local items = GetInventory();
for i in items.list do
if string.match(i.Name, "Spiritshot") or string.match(i.Name, "Soulshot") then
ActivateSoulShot(i.displayId,value)
end;
end;
end;
--== ON CHAT USER MESSAGE FUNCTION ==--
function OnChatUserMessage(chatType, nick, msg)
local Nick = GetMe():GetName();
if (chatType == 2) then -- BY PM
if (string.lower(msg) == "cc") then -- INVITE TO CC
Command('/channelinvite '..nick);
end;
if (string.lower(msg) == InvByPMtext) then -- INVITE TO PT
Command('/invite '..nick);
end;
end;
if (chatType == 3) or (chatType == 2) then -- BY PM OR PARTY CHAT
if (msg:lower() == "givemelead") then -- CHANGING PARTY LEADER
Command('/changepartyleader '..nick);
end;
if (msg:lower() == "gotrain") then -- GO TRAIN
if IsPaused() then
SetPause(false);
end;
if (Search(Nick,PkCharKillerList)) then
ProcessCommand("/scriptStart KillPKToons.lua");
end;
if ((GetMe():GetClass() > 178) and (GetMe():GetClass() < 182)) or ((GetMe():GetClass() > 165) and (GetMe():GetClass() < 171)) or ((GetMe():GetClass() == 189 )) or ((GetMe():GetClass() > 157) and (GetMe():GetClass() < 162))or ((GetMe():GetClass() > 161) and (GetMe():GetClass() < 166))or ((GetMe():GetClass() == 188 ))or ((GetMe():GetClass() > 175) and (player:GetClass() < 179))or ((GetMe():GetClass() > 151) and (GetMe():GetClass() < 158))or ((GetMe():GetClass() > 147) and (GetMe():GetClass() < 152)) then
ProcessCommand("/scriptStart AurasEnable.lua");
end;
if (GetMe():GetClass() > 170) and (GetMe():GetClass() < 176) then
ProcessCommand("/scriptStart RessExecute.lua");
ProcessCommand("/scriptStart IssBuffExecute.lua");
if PickupCheck == false then
PickupCheck = true;
ProcessCommand("/apickup");
end;
end;
if (GetMe():GetClass() > 178) and (GetMe():GetClass() < 182) then
ProcessCommand("/scriptStart HealerPurge.lua");
ProcessCommand("/scriptStart RessExecute.lua");
ProcessCommand("/scriptStart ManaExecute.lua");
end;
if ((GetMe():GetClass() > 165) and (GetMe():GetClass() < 171)) or ((GetMe():GetClass() == 189 )) or ((GetMe():GetClass() > 157) and (GetMe():GetClass() < 162)) or ((GetMe():GetClass() > 161) and (GetMe():GetClass() < 166)) or ((GetMe():GetClass() == 188 )) or ((GetMe():GetClass() > 151) and (GetMe():GetClass() < 158)) then
ProcessCommand("/scriptStart DDsExecute.lua");
end;
if ((GetMe():GetClass() > 178) and (GetMe():GetClass() < 182))or ((GetMe():GetClass() > 170) and (GetMe():GetClass() < 176))or ((GetMe():GetClass() > 165) and (GetMe():GetClass() < 171))or ((GetMe():GetClass() == 189 ))or ((GetMe():GetClass() > 157) and (GetMe():GetClass() < 162))or ((GetMe():GetClass() > 161) and (GetMe():GetClass() < 166))or ((GetMe():GetClass() == 188 ))or ((GetMe():GetClass() > 151) and (GetMe():GetClass() < 158)) then
ProcessCommand("/scriptStart SelfBuffandUDGOD.lua");
end;
if (GetMe():GetClass() > 147) and (GetMe():GetClass() < 152) then
if TankingCheck == false then
ProcessCommand("/t");
TankingCheck = true;
end;
end;
if (Search(Nick,ProfList)) then
ProcessCommand("/scriptStart trashDeleteItem.lua");
end;
end;
if (msg:lower() == "stoptrain") then -- STOP TRAIN
if not IsPaused() then
SetPause(true);
end;
ProcessCommand("/scriptStopAll");
if (GetMe():GetClass() > 147) and (GetMe():GetClass() < 152) then
if TankingCheck then
TankingCheck = false;
ProcessCommand("/t");
end;
end;
if (GetMe():GetClass() > 170) and (GetMe():GetClass() < 176) then
if PickupCheck then
PickupCheck = false;
ProcessCommand("/apickup");
end;
end;
end;
if ((GetMe():GetClass() > 178) and (GetMe():GetClass() < 182)) then -- USE PR
if (msg:lower() == "usepr") then
local PartyReturnID = 11819;
local PartyReturn = GetSkills():FindById(PartyReturnID);
if (PartyReturn ~= nil) and (PartyReturn:CanBeUsed()) then
UseSkillRaw(PartyReturnID,false,false);
end;
end;
end;
if ((GetMe():GetClass() > 170) and (GetMe():GetClass() < 176)) then -- USE DM
if (msg:lower() == "usedm") then
local DevilsMovementID = 11562;
local DevilsMovement = GetSkills():FindById(DevilsMovementID);
if (DevilsMovement ~= nil) and (DevilsMovement:CanBeUsed()) then
UseSkillRaw(DevilsMovementID,false,false);
end;
end;
if (msg:lower() == "usebr") then -- USE BR
local BattleRhapsodyID = 11544;
local BattleRhapsody = GetSkills():FindById(BattleRhapsodyID);
if (BattleRhapsody ~= nil) and (BattleRhapsody:CanBeUsed()) then
UseSkillRaw(BattleRhapsodyID,false,false);
end;
end;
end;
if (msg:lower() == "isave") then -- SAVE CONFIG IN PARTY
ProcessCommand("/isave");
end;
if (msg:lower() == "uselearnallskills") then -- LEARNALLSKILLS IN PARTY
LearnAllSkills();
end;
if (msg:lower() == "enableshots") then -- ENNABLE SHOTS IN PARTY
Shots(true);
end;
if (msg:lower() == "disableshots") then -- DISSABLE SHOTS IN PARTY
Shots(false);
end;
end;
end;
function CheckPartyCount() -- PARTY COUNT CHECK
local MyParty = GetPartyList();
local PeopleInParty = 1;
for member in MyParty.list do
if (member:GetDistance() < 2100) then
PeopleInParty = PeopleInParty + 1;
end;
end;
return PeopleInParty
end;
function DoINeedEnableBOt() -- BOT ENABLER IF PPL COUNT OR JUST FROM LIST OF MEMBERS
local PeopleInPartyCount = CheckPartyCount();
local me = GetMe():GetName();
if (PeopleInPartyCount == 6) and (me == PT_PK_LEADER) then
return true;
end;
if (PeopleInPartyCount == 2) and (me == PT_Small) then
return true;
end;
if (PeopleInPartyCount == 7) and (Search(me,PT_MA_LIST)) then
return true;
end;
if (Search(me,PTMemberToInv01)) or (Search(me,PTMemberToInv02)) or (Search(me,PTMemberToInv03)) or (Search(me,PTMemberToInv04)) or (Search(me,Small_PT)) or (Search(me,PTMemberToInvPK)) then -- FULL PT MEMBERS
return true;
end;
return false;
end;
function InviterToPT(PLeaderNick,List)
local MyParty = GetPlayerList();
for member in MyParty.list do
if (member:GetDistance() < 1600) and not (member:IsMyPartyMember()) then
local MyName = GetMe():GetName();
if (MyName == PLeaderNick) and (Search(member:GetName(),List)) then
Command("/invite ".. member:GetName())
end;
end;
end;
end;
function InviteToPT()
InviterToPT (PT_leader01,PTMemberToInv01);InviterToPT (PT_leader02,PTMemberToInv02);InviterToPT (PT_leader03,PTMemberToInv03);InviterToPT (PT_leader04,PTMemberToInv04);InviterToPT (PT_Small,Small_PT);InviterToPT (PT_PK_LEADER,PTMemberToInvPK);
end;
function OnTick1s()
if IsLogedIn() then
if AutoStartBot then
if WarAlarmListCheck == false then
if (Search(GetMe():GetName(),WarAlarmList)) then
ProcessCommand("/alarmwar");
WarAlarmListCheck = true;
end;
end;
if (Search(GetMe():GetName(),PT_MA_LIST)) or (GetMe():GetName() == PT_Small) or (GetMe():GetName() == PT_PK_LEADER) then
InviteToPT()
end;
if DoINeedEnableBOt() then
if not BotEnableCheck then
if IsPaused() then
SetPause(false);
BotEnableCheck = true;
end;
end;
end;
if not IsPaused() then
if (GetMe():GetClass() > 147) and (GetMe():GetClass() < 152) then
if not TankingCheck then
ProcessCommand("/t");
TankingCheck = true;
end;
end;
if (Search(GetMe():GetName(),PT_MA_LIST)) then
if not AlarmCheck then
local PeopleInPartyCount = CheckPartyCount();
if PeopleInPartyCount == 7 then
ProcessCommand("/alarm");
AlarmCheck = true;
end;
end;
end;
if not PickupHerb then
if (Search(GetMe():GetName(),PickupHerbList)) then
ProcessCommand("/scriptStart 1HERB.lua");
PickupHerb = true;
end;
end;
if not IssOOP then
if (Search(GetMe():GetName(),IssOOPList)) then
ProcessCommand("/scriptStart IssBuffExecuteOOP.lua");
IssOOP = true;
end;
end;
if not ScroolHB then
if (Search(GetMe():GetName(),ScroolHBList)) then
ProcessCommand("/scriptStart 1UseHB.lua");
ScroolHB = true;
end;
end;
if not AurasEnableCheck then
if ((GetMe():GetClass() > 178) and (GetMe():GetClass() < 182)) or ((GetMe():GetClass() > 165) and (GetMe():GetClass() < 171)) or ((GetMe():GetClass() == 189 )) or ((GetMe():GetClass() > 157) and (GetMe():GetClass() < 162))or ((GetMe():GetClass() > 161) and (GetMe():GetClass() < 166))or ((GetMe():GetClass() == 188 ))or ((GetMe():GetClass() > 175) and (GetMe():GetClass() < 179))or ((GetMe():GetClass() > 151) and (GetMe():GetClass() < 158))or ((GetMe():GetClass() > 147) and (GetMe():GetClass() < 152)) then
ProcessCommand("/scriptStart AurasEnable.lua");
AurasEnableCheck = true;
end;
end;
if (GetMe():GetClass() > 170) and (GetMe():GetClass() < 176) then
if not IssListCheck then
ProcessCommand("/scriptStart RessExecute.lua");
ProcessCommand("/scriptStart IssBuffExecute.lua");
IssListCheck = true;
end;
if not PickupCheck then
PickupCheck = true;
ProcessCommand("/apickup");
end;
end;
if not HealerListCheck then
if (GetMe():GetClass() > 178) and (GetMe():GetClass() < 182) then
ProcessCommand("/scriptStart HealerPurge.lua");
ProcessCommand("/scriptStart RessExecute.lua");
ProcessCommand("/scriptStart ManaExecute.lua");
HealerListCheck = true;
end;
end;
if not DDsExecuteListCheck then
if ((GetMe():GetClass() > 165) and (GetMe():GetClass() < 171)) or ((GetMe():GetClass() == 189 )) or ((GetMe():GetClass() > 157) and (GetMe():GetClass() < 162)) or ((GetMe():GetClass() > 161) and (GetMe():GetClass() < 166)) or ((GetMe():GetClass() == 188 )) or ((GetMe():GetClass() > 151) and (GetMe():GetClass() < 158)) then
ProcessCommand("/scriptStart DDsExecute.lua");
DDsExecuteListCheck = true;
end;
end;
if not SelfBuffsListCheck then
if ((GetMe():GetClass() > 178) and (GetMe():GetClass() < 182))or ((GetMe():GetClass() > 170) and (GetMe():GetClass() < 176))or ((GetMe():GetClass() > 165) and (GetMe():GetClass() < 171))or ((GetMe():GetClass() == 189 ))or ((GetMe():GetClass() > 157) and (GetMe():GetClass() < 162))or ((GetMe():GetClass() > 161) and (GetMe():GetClass() < 166))or ((GetMe():GetClass() == 188 ))or ((GetMe():GetClass() > 151) and (GetMe():GetClass() < 158)) then
ProcessCommand("/scriptStart SelfBuffandUDGOD.lua");
SelfBuffsListCheck = true;
end;
end;
if not PkListCheck then
if (Search(GetMe():GetName(),PkCharKillerList)) then
ProcessCommand("/scriptStart KillPKToons.lua");
PkListCheck = true;
end;
end;
if not ProfListCheck then
if (Search(GetMe():GetName(),ProfList)) then
ProcessCommand("/scriptStart trashDeleteItem.lua");
ProfListCheck = true;
end;
end;
if not pkRessExecuteCheck then
if (Search(GetMe():GetName(),pkRessExecuteLIST)) then
ProcessCommand("/scriptStart PkRessExecute.lua");
pkRessExecuteCheck = true;
end;
end;
if not pkAssistExecuteCheck then
if (Search(GetMe():GetName(),pkAssistExecuteCheckLIST)) then
ProcessCommand("/scriptStart PkAssistExecute.lua");
pkAssistExecuteCheck = true;
end;
end;
if not pkTargetExecuteCheck then
if (Search(GetMe():GetName(),pkTargetExecuteCheckLIST)) then
ProcessCommand("/scriptStart PkTargetExecute.lua");
pkTargetExecuteCheck = true;
end;
end;
end;
end;
end;
end;
function OnLogout()
AurasEnableCheck = false;PkListCheck = false;IssListCheck = false;HealerListCheck = false;DDsExecuteListCheck = false;ProfListCheck = false;BotEnableCheck = false;pkRessExecuteCheck = false;pkAssistExecuteCheck = false;pkTargetExecuteCheck = false;PickupCheck = false;SelfBuffsListCheck = false;AlarmCheck = false;WarAlarmListCheck = false;ScroolHB = false;IssOOP = false;
end;
function OnDisconnect()
AurasEnableCheck = false;PkListCheck = false;IssListCheck = false;HealerListCheck = false;DDsExecuteListCheck = false;ProfListCheck = false;BotEnableCheck = false;pkRessExecuteCheck = false;pkAssistExecuteCheck = false;pkTargetExecuteCheck = false;PickupCheck = false;SelfBuffsListCheck = false;AlarmCheck = false;WarAlarmListCheck = false;ScroolHB = false;IssOOP = false;
end;
PUSH IF HELPED
|
|