Everyone who has never used our Bots before, can test each one for 2 days without any limitation.
The trial is given automatically when you login on the Bot, but in some cases it wouldn't work (security reasons).
If this happens, send me a private message and i will be checking the failed trials manually and adding it for those who didn't get it.
We are looking for resellers who may accept payment methods different from ours, including classictibia's cash, realesta's cash, mastercores' cash, etc. Interested? Click here at anytime.



Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trying to use special areas.
#1
Hi there again,
I'm trying "implement" the logic that you explained in this post: 
|Only Registered members can see download links. | Click here to buy subscription or here to register.

But, I simply cannot turn off the special area since I cannot get the information when the monster die.

My code is like that:

-- Persist 1 : Turning on the Special Areas on targeting
sa = {
    'Targeting/Special Areas/0/Enabled',
    'Targeting/Special Areas/1/Enabled',
    'Targeting/Special Areas/2/Enabled',
    'Targeting/Special Areas/3/Enabled',
    'Targeting/Special Areas/4/Enabled',
    'Targeting/Special Areas/5/Enabled',
    'Targeting/Special Areas/6/Enabled',
    'Targeting/Special Areas/7/Enabled',
    'Targeting/Special Areas/8/Enabled',
    'Targeting/Special Areas/9/Enabled'
}

if getlurelocation().posx == self().posx and getlurelocation().posy == self().posy and getlurelocation().posz == self().posz and hastarget() == true then
    for _, sqm in ipairs(sa) do
        if getsettings(sqm) == false then
            setsettings(sqm, 'yes')
        end
    end
end


sa = {
    'Targeting/Special Areas/0/Enabled',
    'Targeting/Special Areas/1/Enabled',
    'Targeting/Special Areas/2/Enabled',
    'Targeting/Special Areas/3/Enabled',
    'Targeting/Special Areas/4/Enabled',
    'Targeting/Special Areas/5/Enabled',
    'Targeting/Special Areas/6/Enabled',
    'Targeting/Special Areas/7/Enabled',
    'Targeting/Special Areas/8/Enabled',
    'Targeting/Special Areas/9/Enabled'
}

if target().ismonster == false and getsettings(sa[0])== true then
    for _, sqm in ipairs(sa) do
        setsettings(sqm, 'no')
    end
end
Reply

#2
Hello.

Use target() but checking for id. if id == 0 means not targeting anything.
Notice target() returns information about creature that Targeting chose to attack.
attacked() returns about red-square creature!
Reply



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016