PDA

View Full Version : using script to repeat talk to npc



therealemcee
12-15-2013, 10:16 PM
I am trying to make a script that will exchange life crystals for rings at chest khas

this is what I got so far:

if (Self.ItemCount("life crystal") > 0) then
Self.SayToNpc({"hi", "gamel rebel", "magic crystal lugri deathcurse", "yes"}, 30)
end


but it just doesn't work, could someone help me to make it work?

Kush
12-15-2013, 10:25 PM
if (Self.ItemCount("life crystal") > 0) then
Self.Say("hi")
repeat
Self.SayToNpc({"gamel rebel", "magic crystal lugri deathcurse", "yes"}, 30)
until not(Self.ItemCount("life crystal") > 0)
end

BUg
12-15-2013, 10:34 PM
if you repeat it on the same line, it works:
gamel rebel magic crystal lugri deathcurse yes
gamel rebel magic crystal lugri deathcurse yes
gamel rebel magic crystal lugri deathcurse yes
gamel rebel magic crystal lugri deathcurse yes
gamel rebel magic crystal lugri deathcurse yes


I used to do it manually and just put it on my tibiahotkeys to send automatically. Much faster

therealemcee
12-15-2013, 10:35 PM
if (Self.ItemCount("life crystal") > 0) then
Self.Say("hi")
repeat
Self.SayToNpc({"gamel rebel", "magic crystal lugri deathcurse", "yes"}, 30)
until not(Self.ItemCount("life crystal") > 0)
end


just tried it, and it almost worked(got to gamel rebel), then realised I didn't have "yes" after that.

Once I added the "yes", it worked for me, thanks

artek007
01-26-2015, 06:22 PM
Full script


if (Self.ItemCount("life crystal") > 0) then
Self.Say("hi")
repeat
Self.SayToNpc({"gamel rebel", "yes", "magic crystal lugri deathcurse", "yes"}, 30)
until not(Self.ItemCount("life crystal") > 0)
end