Code:if $lastmsg.content ~= 'Twist of Fate' then gotolabel('twist') end
Doesn't seem to work, why doesnt it work?
13:46 Received blessings:
No blessings received
Code:if $lastmsg.content ~= 'Twist of Fate' then gotolabel('twist') end
Doesn't seem to work, why doesnt it work?
13:46 Received blessings:
No blessings received
Change NpcName, BlessName and NpcMsgs
local npcname = 'Eremo'
local blessname = 'solitude'
local npcmsg = 'So receive the wisdom of solitude, pilgrim.'
local npcmsg2 = 'You already possess this blessing.'
local npc = getcreaturebyname(npcname)
--dont change from here
local blessed = false
if npc.onscreen then
while not blessed and npc.onscreen do
reachcreature(npc)
if npc.dist <= 1 then
if ischannel('NPCs') then
npcsay('hi') waitping()
else
say('hi') wait(2000, 2500)
end
npcsay(blessname) waitping()
npcsay('yes')
-- wait for NPC msg
local t = $timems + 2500
while $timems < t and not blessed do
wait(100)
if ($lastnpcmsg.sender == npcname and ($lastnpcmsg.content == npcmsg or $lastnpcmsg.content == npcmsg2)) then
blessed = true
end
end
else
playsound('monster.wav')
wait(1000)
end
end
else
gotolabel($wptid-1)
playsound('monster.wav')
end
Last edited by Garkstal; 12-19-2014 at 01:25 PM.
http://i.imgur.com/lkWkIMg.png
........................Script Name......................
Profession
Asura Palace ED + EK Characters for sale! | Like Our Facebook! | Sell Tibia Gold
I am using this action in my house to see if it got twist, not after it died so thanks @borges but that action is not what I need.
And @Garkstal, it only get messages in server log, I thought of writing like:
if $lastmsg.content ~= .. 'Twist of Fate' then
gotolabel('twist')
end
But it gives me an error.
Type of messages.
-- Credits to Anonymickey, for testing the msg types
MSG_STATUS = 0 -- Status messages (In the screen).
MSG_DEFAULT = 1 -- Any player/npc message in Default channel.
MSG_WHISPER = 2 -- Any player whispering.
MSG_YELL = 3 -- Any player yelling.
MSG_NPC = 6 -- Any NPC answers in NPC channel.
MSG_PVT = 7 -- Private messages from other players.
MSG_CHANNEL = 8 -- Any player message in Game/Help/Real/Tutor/Trade channel.
MSG_RED = 16 -- Red alert messages.
MSG_RAID,MSG_ADVANCE = 17,17 -- Any white alert message.
MSG_WELCOME = 18 -- Game/Channel welcome messages.
MSG_STATUSLOG = 19 -- Status messages in Server Log.
MSG_INFO = 20 -- Green messages (like loot message) in Server Log.
MSG_SENT = 22 -- Private messages sent by you.
Will check all last 2000 messages.
foreach message m do
print(m) -- You can check the type, m.type,m.content.
end
New messages
foreach newmessage m do
print(m) -- You can check the type, m.type,m.content.
end
Last edited by Sajean; 12-19-2014 at 02:15 PM.
@Tobbysch you're looking for $lastmsg.content:match('Twist of Fate'), but this returns true, what you want returns false, so you'll have to change the way you're doing to make it work.
When you use the ankh it returns all blessings' names and some other stuff, not only the last blessing name.
This one seems to work, but if char has full bless but not twist of fate it would not work, but I guess this works for me, barely bot with full bless anyways.
Thanks a lot @RoxZin xD !