focus = 0
talk_start = 0
target = 0
following = false
attacking = false
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Good bye then.')
focus = 0
talk_start = 0
end
end
function onCreatureTurn(creature)
end
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end
function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('Hello, ' .. creatureGetName(cid) .. '! I sell ropes (50gp), shovels (20gp), backpacks (1k-gp), fishing rods (100gp) , Bait and picks, propscheck, propsrune, bitchadd and bitchcheck for community reputation!! lumberjacking axes, Say lumberjack')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'helm') then
buy(cid,2501,1,50)
if msgcontains(msg, 'arm') then
buy(cid,2653,1,50)
if msgcontains(msg, 'legs') then
buy(cid,2126,1,50)
if msgcontains(msg, 'bots') then
buy(cid,2649,1,50)
if msgcontains(msg, 'ring') then
buy(cid,2165,1,50)
if msgcontains(msg, 'ammy') then
buy(cid,2210,1,50)
if msgcontains(msg, 'rope') then
buy(cid,2120,1,50)
elseif msgcontains(msg, 'shovel') then
buy(cid,2554,1,20)
elseif msgcontains(msg, 'backpack') then
buy(cid,1988,1,1000)
elseif msgcontains(msg, 'fishing rod') then
buy(cid,2580,1,100)
elseif msgcontains(msg, 'torch') then
buy(cid,2050,1,2)
elseif msgcontains(msg, 'goldup') then
buy(cid,2152,1,100)
elseif msgcontains(msg, 'platdown') then
buy(cid,2148,100,100)
elseif msgcontains(msg, 'platup') then
buy(cid,2160,1,10000)
elseif msgcontains(msg, 'crystaldown') then
buy(cid,2152,100,10000)
elseif msgcontains(msg, 'crystalup') then
buy(cid,2320,1,1000000)
elseif msgcontains(msg, 'skulldown') then
buy(cid,2160,100,1000000)
elseif msgcontains(msg, 'lumberjack') then
buy(cid,2386,1,100000)
elseif msgcontains(msg, 'umbrella') then
buy(cid,2229,1,150)
elseif msgcontains(msg, 'umbrella2') then
buy(cid,2229,90,150)
elseif msgcontains(msg, 'umbrella3') then
buy(cid,2160,90,150)
elseif msgcontains(msg, 'document') then
buy(cid,2653,1,150)
elseif msgcontains(msg, 'document1') then
buy(cid,2649,1,150)
elseif msgcontains(msg, 'document2') then
buy(cid,2501,1,150)
elseif msgcontains(msg, 'document3') then
buy(cid,2165,1,150)
elseif msgcontains(msg, 'document4') then
buy(cid,2126,1,150)
elseif msgcontains(msg, 'document5') then
buy(cid,2207,1,150)
elseif msgcontains(msg, 'yellowbackpack') then
buy(cid,1999,1,1000)
elseif msgcontains(msg, 'redbackpack') then
buy(cid,2000,1,1000)
elseif msgcontains(msg, 'purplebackpack') then
buy(cid,2001,1,1000)
elseif msgcontains(msg, 'bluebackpack') then
buy(cid,2002,1,1000)
elseif msgcontains(msg, 'greybackpack') then
buy(cid,2003,1,1000)
elseif msgcontains(msg, 'goldbackpack') then
buy(cid,2004,1,1000)
elseif msgcontains(msg, 'greenbackpack') then
buy(cid,1998,1,1000)
elseif msgcontains(msg, 'bait') then
buy(cid,3976,100,1)
elseif msgcontains(msg, 'pick') then
buy(cid,2553,1,1000000)
elseif msgcontains(msg, 'propsrune') then
buy(cid,2290,1,500000)
elseif msgcontains(msg, 'propscheck') then
buy(cid,2291,1,100000)
elseif msgcontains(msg, 'bitchadd') then
buy(cid,2265,1,500000)
elseif msgcontains(msg, 'bitchcheck') then
buy(cid,2266,1,100000)
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
focus = 0
talk_start = 0
end
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Next Please...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Good bye then.')
focus = 0
end
end
end