Hello.
1st script
If you wanna run any lua code from a message, you can use a script like this.
Examples:
00:00 Main character: print('lol')
Then the character that receives will run the command "print('lol')".
00:00 Main character: cast('exeta res')
Then the character that receives will run the command "cast('exeta res')".
local PLAYER = 'Main character'
local messages = getnewmessages('Default')
for _, msg in ipairs(messages) do
if msg.sender:lower() == PLAYER:lower() then
local command = loadstring(msg.content)
command()
end
end
local messages_pm = getnewmessages(PLAYER)
for _, msg in ipairs(messages_pm) do
if msg.sender:lower() == PLAYER:lower() then
local command = loadstring(msg.content)
command()
end
end
2nd script
When say the "WORD PLAYER" it will shoot the rune or attack on the PLAYER.
E.g.:
16:17 Leader Name: SD Knight
It will make people who are using this script to shoot SD on player "Knight".
16:18 Leader Name: SD Weak Sorcereer
It will make people who are using this script to shoot SD on player "Weak Sorcereer".
local ComboLeader = "Leader Name"
local RUNES_SHOOT = {
{ ITEM = "sudden death rune", WORD = "SD" },
{ ITEM = "heavy magic missile rune", WORD = "HMM" },
{ ITEM = "attack", WORD = "attack" },
}
--[[ DON'T EDIT BELOW THIS LINE --]]
if cancast() then
local MESSAGES = getnewmessages(PLAYER)
for i,m in pairs(MESSAGES) do
if m.sender ~= nil and m.sender ~= '' and m.sender:lower() == ComboLeader:lower() then
local temp = m.content:token(nil,' ')
if temp[1] ~= nil and temp[2] ~= nil then
for RUNE_INDEX = 1, #RUNES_SHOOT do
if RUNES_SHOOT[RUNE_INDEX].WORD:lower() == temp[1]:lower() then
local RuneItem = RUNES_SHOOT[RUNE_INDEX].ITEM
local TargetName = ''
if #temp > 2 then
TargetName = temp[2]
for SPLIT_INDEX = 3, #temp do
TargetName = (TargetName:concat(temp[SPLIT_INDEX]):match("^%s*(.-)%s*$"))
end
else
TargetName = (temp[2]:match("^%s*(.-)%s*$"))
end
if TargetName ~= '' and RuneItem ~= '' then
if RuneItem == "attack" then
attack(TargetName)
wait(1000)
else
useitemoncreature(RuneItem, TargetName)
wait(1000)
end
end
return
end
end
end
end
end
end