PDA

View Full Version : Knight help with this script



master93
04-20-2017, 05:33 PM
local item = 3186
local whiteList = {'player name'}
local healthPercent = 90

function isInArray(array, t)
for _, item in ipairs(array) do
if(item == t) then
return true
end
end
return false
end

function onThink()
for i = CREATURES_LOW, CREATURES_HIGH do
local creature = Creature.GetFromIndex(i)
if(creature:isValid() and creature:ID() ~= Self.ID())then
if(creature:isOnScreen() and creature:isVisible() and creature:isAlive() and creature:isPlayer())then
if creature:DistanceFromSelf() < 3 then
if(isInArray(whiteList, creature:Name())) then
if(creature:HealthPercent() <= healthPercent) then
Self.UseItemWithCreature(item, creature:ID())
end
end
end
end
end
end
end

while(true)do
onThink()
wait(100)
end

master93
04-20-2017, 05:33 PM
Error: unexpected symbol near 'ÿ'
This is an error with user-input and should not be reported as a bug with XenoBot.

bombka1234
04-21-2017, 09:12 AM
Line : 1 ?

Just change your coding type from 'UTF-8' to 'ANSI' during 'save as' .

master93
04-27-2017, 04:33 AM
im using wordpad so how to save it as ansi? :D

Samoxx
12-25-2017, 12:44 AM
You can save it by using [ Sublime Text3 ], it's a software code editor, simple and easy to use.