PDA

View Full Version : Error: unexpected symbol near 'ď'



Mijzee
07-10-2014, 02:37 PM
Hi everyone!

I Have problems with my script. Exactly when i wanna load it i have error:


16:16 XenoScript Error:
Script: darashia.lua
Line #: 1
Chunk: C:?Users?OEM?DOCUME?1?XenoBot?Scripts??darashia.lu a
Error: unexpected symbol near 'ď'
This is an error with user-input and should not be reported as a bug with XenoBot.

becouse i can find that error, mayby someone of you can find that..

i add to my script:


---------------------------------
--------Twoj Waypoint------------
-------Created By Sanix----------
---------------------------------

----------- BP SETUP ------------
-- [BP 1] -- Main
-- [BP 2] -- Produkty
-- [BP 3] -- Gold

----------- DP SETUP ------------
-- [DP 1] -- Rare
-- [DP 2] -- Produkty

------------ Settings -----------

-- Mana Potions --

local ManasToLeave = 100 -- Z iloma manasami wracać
local WantedManas = 200 -- Ile Manasow kupić
local ManaPotID = 237 -- Mana Potion ID
local ManaCost = 80 -- Mana Potion koszt

-- Health Potions --

local HealthToLeave =0 -- Z iloma healtami wracać
local WantedHealth = 0 -- Ile Healtow Kupić
local HealthPotID = 0 -- Health Potion ID
local HealthCost = 0 -- Koszt HP Potka

-- Spears --

local SpearToLeave = 200 -- Z iloma spearami wracać
local WantedSpear = 1000 -- Ile Spearów Kupić
local SpearID = 16142 -- Spear ID
local SpearCost = 15 -- Koszt Speara

-- Other Options --

local MainBP = 2867 -- ID plecaka glownego (Czerwony)
local ItemBP = 9602 -- ID plecaka na itemy (Pomaranczowy)
local GoldBP = 2872 -- ID plecaka na kase (Camouflage)
local MinCap = 50 -- Od ilu Capa wracać
local HideEquipment = true -- Zminimalizować EQ

-- Floor Settings --

local SecondFloor = true -- Tego nie zmieniajcie


Targeting.Start()
Looter.Start()

--------------------------------------------------------------------
--------------------------------------------------------------------
--------------------------------------------------------------------
--------------------------------------------------------------------
--------------------------------------------------------------------

registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")

local info = [[]]
wait(5000)

print([[
--<Waypoint 100% Afk>--]])
wait(5000)

-----------------------------------------------------------------------------------------------------------------------------------------
function onWalkerSelectLabel(labelName)

if (labelName == "Checker") then
if (Self.ItemCount(ManaPotID) <= ManasToLeave) or (Self.ItemCount(HealthPotID) <= HealthToLeave) or (Self.ItemCount(SpearID) <= SpearToLeave) or (Self.Cap() < MinCap) then
gotoLabel("Leave")
else
gotoLabel("Start Hunt")
end

elseif (labelName == "TravelGo") then
setWalkerEnabled(false)
delayWalker(5000)
Self.Say("hi")
sleep(math.random(700, 1400))
Self.SayToNpc("wyspa na ktora chcesz plynanc") -- Tutaj wpisz wyspe na ktora sie udajesz.
sleep(math.random(300, 1000))
Self.SayToNpc("yes")
setWalkerEnabled(true)

elseif (labelName == "TravelBack") then
setWalkerEnabled(false)
delayWalker(5000)
Self.Say("hi")
sleep(math.random(700, 1400)) -
Self.SayToNpc("Wyspa powrotna") -- Tutaj wpisz wyspe powrotna
sleep(math.random(300, 1000))
Self.SayToNpc("yes")
setWalkerEnabled(true)

elseif (labelName == "Deposit") then
setWalkerEnabled(false)
Self.ReachDepot()
Self.DepositItems({7436, 0}, {7454, 0}) -- Tutaj dodajesz ID itemkow ktore ma odkładać do Depo a po przecinku backpack w kolejności od lewej strony 0 oznacza miejsce pierwsze a 1 miejsce 2, 2 to miejsce trzecie i tak dalej
Self.DepositItems({10293, 1}, {10311, 1}) -- tutaj to smao co wyżej bo jak jest za dużo itemek w jednej lini to się zawiesza
wait(1500,1900)

elseif (labelName == "Cash") then
setWalkerEnabled(false)
delayWalker(5000)
Self.Say("hi")
sleep(math.random(700, 1400))
Self.SayToNpc("deposit all")
sleep(math.random(300, 1000))
Self.SayToNpc("yes")
setWalkerEnabled(true)

elseif (labelName == "Withdraw") then
setWalkerEnabled(false)
delayWalker(5000)
Self.SayToNpc("hi")
sleep(math.random(700, 1400))
Self.WithdrawMoney((ManaCost*(WantedManas-Self.ItemCount(ManaPotID))))
sleep(math.random(700, 1400))
Self.WithdrawMoney((HealthCost*(WantedHealth-Self.ItemCount(HealthPotIDID))))
sleep(math.random(700, 1400))
Self.WithdrawMoney(100)
sleep(math.random(700, 1400))
Self.SayToNpc("yes")
setWalkerEnabled(true)

elseif (labelName == "Ammo") then
setWalkerEnabled(false)
delayWalker(10000)
Self.SayToNpc("hi")
sleep(math.random(800, 1700))
Self.SayToNpc("trade")
sleep(math.random(2000, 2400))
Self.ShopBuyItem(SpearID, (WantedSpear-Self.ItemCount(SpearID)))
setWalkerEnabled(true)

elseif (labelName == "Potions") then
setWalkerEnabled(false)
delayWalker(10000)
Self.SayToNpc("hi")
sleep(math.random(800, 1700))
Self.SayToNpc({"Hi", "flasks", "yes", "yes", "yes", "Trade"}, 65)
sleep(math.random(800, 1700))
Self.SayToNpc("trade")
sleep(math.random(2000, 2400))
Self.ShopBuyItem(ManaPotID, (WantedManas-Self.ItemCount(ManaPotID)))
sleep(math.random(2000, 2400))
Self.ShopBuyItem(HealthPotID, (WantedHealth-Self.ItemCount(HealthPotID)))
sleep(math.random(800, 1700))
setWalkerEnabled(true)

elseif (labelName == "FullCheck") then
if (Self.ItemCount(ManaPotID) < WantedManas) or (Self.Cap() < MinCap) or (Self.ItemCount(HealthPotID) < WantedHealth) then
gotoLabel("PreDeposit")
else
gotoLabel("LetsHunt")
end

elseif (labelName == "ResetBp") then
Walker.Stop()

Container.Close(ItemBP)
wait(1000)
Container.Close(GoldBP)
wait(1000)
Container.GetFirst():OpenChildren(ItemBP)
wait(1000)
Container.GetFirst():OpenChildren(GoldBP)
wait(1000)
Container.GetByName(ItemBP):Minimize()
wait(1000)
Container.GetByName(GoldBP):Minimize()
wait(200)
if (HideEquipment) then
Client.HideEquipment()
wait(1000)
end
Walker.Start()
end
end


----------------------- Functions ----------------------
function SellItems(item) -- item = item ID
wait(300, 1700)
Self.ShopSellItem(item, Self.ShopGetItemSaleCount(item))
wait(900, 1200)
end

function BuyItems(item, count) -- item = item id, count = how many you want to buy up to
wait(900, 1200)
if (Self.ItemCount(item) < count) then
Self.ShopBuyItem(item, (count-Self.ItemCount(item)))
wait(200, 500)
end
end

Self.ReachDepot = function (tries)
local tries = tries or 3
Walker.Stop()
local DepotIDs = {3497, 3498, 3499, 3500}
local DepotPos = {}
for i = 1, #DepotIDs do
local dps = Map.GetUseItems(DepotIDs[i])
for j = 1, #dps do
table.insert(DepotPos, dps[j])
end
end

local function gotoDepot()
local pos = Self.Position()
print("Ilosc znalezionych Depo: " .. tostring(#DepotPos))
for i = 1, #DepotPos do
location = DepotPos[i]
Self.UseItemFromGround(location.x, location.y, location.z)
wait(1000, 2000)
if Self.DistanceFromPosition(pos.x, pos.y, pos.z) >= 1 then
wait(5000, 6000)
if Self.DistanceFromPosition(location.x, location.y, location.z) == 1 then
Walker.Start()
return true
end
else
print("To depo jest zajete, szukam dalej.")
end
end
return false
end

repeat
reachedDP = gotoDepot()
if reachedDP then
return true
end
tries = tries - 1
sleep(100)
print("Nie udalo sie dotrzec do depo... " .. tries .. " szukam dalej.")
until tries <= 0

return false
end

Map.GetUseItems = function (id)
if type(id) == "string" then
id = Item.GetID(id)
end
local pos = Self.Position()
local store = {}
for x = -7, 7 do
for y = -5, 5 do
if Map.GetTopUseItem(pos.x + x, pos.y + y, pos.z).id == id then
itemPos = {x = pos.x + x, y = pos.y + y, z = pos.z}
table.insert(store, itemPos)
end
end
end
return store
end

Please, help me, becouse i have only 3 day pacc left ;(

Glowingstick
07-10-2014, 02:56 PM
I think this happens when you edit the lua file in a notepad document, download Notepad++ (http://notepad-plus-plus.org/) or Sublime (http://www.sublimetext.com/) and edit the document with that instead

soul4soul
07-10-2014, 11:09 PM
The error is caused by the file encoding. encode it with UTF-8 without BOM. Its the encoding xenobot uses to create lua and the encoding of xenolib.lua.

Mijzee
07-11-2014, 06:39 AM
10501

Now i have that problem when i make my own script( it is when i wanna load walker).. Any ideas?