• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • If you're using Gesior 2012 or MyAAC, please review this thread for information about a serious security vulnerability and a fix.

Some help at a Script error pls

Repsor

New Member
Joined
May 26, 2022
Messages
10
Solutions
1
Reaction score
0
The problem with the ip is solved

but now i have a Script error with my modular Window

All informantion are below
:eek:
 
Last edited:
OP
OP
R

Repsor

New Member
Joined
May 26, 2022
Messages
10
Solutions
1
Reaction score
0
its all fine my friends i just needed open port 7171 7172 i just forgot that :D

But i have a other problem :D
Client version 12.86
Otengine Latest canary/otbrasil

[2022-26-05 22:28:14.388] [error] modal_window.lua
[2022-26-05 22:28:14.388] [error] ...r\Desktop\otserver\data\scripts\actions\modal_window.lua:25: '=' expected near 'end'

i wanted to add modal windows so that i could use the Bosseye checker

script for Modal windows:
local modal = Action()

function modal.onUse(player, item, fromPosition, target, toPosition, isHotkey)
player:registerEvent("modal")

local w = ModalWindow(0, "title")
w:addChoice(1, "choice name")
w:addButton(0, "Select")
w:addButton(1, "Cancel")
w:setDefaultEnterButton(0)
w:setDefaultEscapeButton(1)
w:sendToPlayer(player)
return true
end

modal:id(xxxx)
modal:register()

local modal = CreatureEvent("modal")

function modal.onModalWindow(player, modalWindowId, buttonId, choiceId)
player:unregisterEvent("modal")
if buttonId == 0 then
something
end
return true
end

modal:type("modalwindow")
modal:register()


Error for Boss Checker:
[2022-26-05 23:10:11.292] [error] Lua script error:
scriptInterface: [Scripts Interface]
scriptId: [C:\Users\Administrator\Desktop\otserver\data\scripts\custom\boss_doll.lua:callback]
timerEvent: []
callbackId:[]
function: []
error [data/lib/custom/boss_eye.lua:18: attempt to index field 'AlavancaBosses' (a nil value)
stack traceback:
[C]: in function '__index'
data/lib/custom/boss_eye.lua:18: in function 'sendBossWindow'
...rator\Desktop\otserver\data\scripts\custom\boss_doll.lua:8: in function <...rator\Desktop\otserver\data\scripts\custom\boss_doll.lua:7>]


Script for modal Boss Checker
function Player:sendBossWindow(bosseye)

-- Modal window design
local window = ModalWindow {
title = bosseye.mainTitle, -- Title of the modal window
message = bosseye.mainMsg, -- The message to be displayed on the modal window
}

-- Add buttons to the window (Note: if you change the names of these you must change the functions in the modal window functionallity!)
window:addButton("Cancel")

-- Set what button is pressed when the player presses enter or escape
window:setDefaultEscapeButton("Cancel")


window:addChoice("-- Soul War Bosses --")

if self:getStorageValue(Storage.GraveDanger.GoshnarsHatred) > os.time() then
window:addChoice("Goshnars Hatred [" .. os.date('%d/%m/%Y - %H:%M:%S', self:getStorageValue(Storage.GraveDanger.GoshnarsHatred)) .."]")
else
window:addChoice("Goshnars Hatred [ON]")
end

if self:getStorageValue(Storage.GraveDanger.GoshnarsMalice) > os.time() then
window:addChoice("Goshnars Malice [" .. os.date('%d/%m/%Y - %H:%M:%S', self:getStorageValue(Storage.GraveDanger.GoshnarsMalice)) .."]")
else
window:addChoice("Goshnars Malice [ON]")
end

if self:getStorageValue(Storage.GraveDanger.GoshnarsSpite) > os.time() then
window:addChoice("Goshnars Spite [" .. os.date('%d/%m/%Y - %H:%M:%S', self:getStorageValue(Storage.GraveDanger.GoshnarsSpite)) .."]")
else
window:addChoice("Goshnars Spite [ON]")
end

if self:getStorageValue(Storage.GraveDanger.GoshnarsCruelty) > os.time() then
window:addChoice("Goshnars Cruelty [" .. os.date('%d/%m/%Y - %H:%M:%S', self:getStorageValue(Storage.GraveDanger.GoshnarsCruelty)) .."]")
else
window:addChoice("Goshnars Cruelty [ON]")
end

if self:getStorageValue(Storage.GraveDanger.GoshnarsGreed) > os.time() then
window:addChoice("Goshnars Greed [" .. os.date('%d/%m/%Y - %H:%M:%S', self:getStorageValue(Storage.GraveDanger.GoshnarsGreed)) .."]")
else
window:addChoice("Goshnars Greed [ON]")
end

if self:getStorageValue(Storage.GraveDanger.GoshnarsMegalomania) > os.time() then
window:addChoice("Goshnars Megalomania [" .. os.date('%d/%m/%Y - %H:%M:%S', self:getStorageValue(Storage.GraveDanger.GoshnarsMegalomania)) .."]")
else
window:addChoice("Goshnars Megalomania [ON]")
end


window:addChoice("-----------------------")
window:addChoice("-- Cobra Bastion --")

if self:getStorageValue(Storage.GraveDanger.CobraBastion.ScarlettTimer) > os.time() then
window:addChoice("Scarlett Etzel [" .. os.date('%d/%m/%Y - %H:%M:%S', self:getStorageValue(Storage.GraveDanger.CobraBastion.ScarlettTimer)) .."]")
else
window:addChoice("Scarlett Etzel [ON]")
end

if self:getStorageValue(Storage.GraveDanger.baelocTimer) > os.time() then
window:addChoice("sir Baeloc [" .. os.date('%d/%m/%Y - %H:%M:%S', self:getStorageValue(Storage.GraveDanger.baelocTimer)) .."]")
else
window:addChoice("sir Baeloc [ON]")
end

if self:getStorageValue(Storage.GraveDanger.lordazaramTimer) > os.time() then
window:addChoice("Lord Azaram [" .. os.date('%d/%m/%Y - %H:%M:%S', self:getStorageValue(Storage.GraveDanger.lordazaramTimer)) .."]")
else
window:addChoice("Lord Azaram [ON]")
end

if self:getStorageValue(Storage.GraveDanger.kingzelosTimer) > os.time() then
window:addChoice("King zelos [" .. os.date('%d/%m/%Y - %H:%M:%S', self:getStorageValue(Storage.GraveDanger.kingzelosTimer)) .."]")
else
window:addChoice(King zelos [ON]")
end

if self:getStorageValue(Storage.GraveDanger.earlosamtimer) > os.time() then
window:addChoice("Earl Osam [" .. os.date('%d/%m/%Y - %H:%M:%S', self:getStorageValue(Storage.GraveDanger.earlosamtimer)) .."]")
else
window:addChoice("Earl Osam [ON]")
end

if self:getStorageValue(Storage.GraveDanger.dukekruleTimer) > os.time() then
window:addChoice("Duke Krule [" .. os.date('%d/%m/%Y - %H:%M:%S', self:getStorageValue(Storage.GraveDanger.dukekruleTimer)) .."]")
else
window:addChoice("Duke Krule [ON]")
end

if self:getStorageValue(Storage.GraveDanger.countvlarkorthTimer) > os.time() then
window:addChoice("count vlarkorth [" .. os.date('%d/%m/%Y - %H:%M:%S', self:getStorageValue(Storage.GraveDanger.countvlarkorthTimer)) .."]")
else
window:addChoice("count vlarkorth [ON]")
end


window:addChoice("-----------------------")
window:addChoice("-- Kilmaresh --")

if self:getStorageValue(Storage.Kilmaresh.UrmahlulluTimer) > os.time() then
window:addChoice("Urmahlullu [" .. os.date('%d/%m/%Y - %H:%M:%S', self:getStorageValue(Storage.Kilmaresh.UrmahlulluTimer)) .."]")
else
window:addChoice("Urmahlullu [ON]")
end


window:addChoice("-----------------------")
window:addChoice("-- Falcons Bastion --")

if self:getStorageValue(Storage.TheSecretLibrary.TheOrderOfTheFalcon.OberonTimer) > os.time() then
window:addChoice("Oberon [" .. os.date('%d/%m/%Y - %H:%M:%S', self:getStorageValue(Storage.TheSecretLibrary.TheOrderOfTheFalcon.OberonTimer)) .."]")
else
window:addChoice("Oberon [ON]")
end


window:addChoice("-----------------------")
window:addChoice("-- Lions Bastion --")

if self:getStorageValue(Storage.TheOrderOfTheLion.Drume.timer) > os.time() then
window:addChoice("Drume [" .. os.date('%d/%m/%Y - %H:%M:%S', self:getStorageValue(Storage.TheOrderOfTheLion.Drume.timer)) .."]")
else
window:addChoice("Drume [ON]")
end


window:addChoice("-----------------------")
window:addChoice("-- Warzone --")

if self:getStorageValue(Storage.DangerousDepths.bosses.TheBaronFromBelow) > os.time() then
window:addChoice("The Baron From Below [" .. os.date('%d/%m/%Y - %H:%M:%S', self:getStorageValue(Storage.DangerousDepths.bosses.TheBaronFromBelow)) .."]")
else
window:addChoice("The Baron From Below [ON]")
end

if self:getStorageValue(Storage.DangerousDepths.bosses.TheDukeOfTheDepths) > os.time() then
window:addChoice("The Duke Of The Depths [" .. os.date('%d/%m/%Y - %H:%M:%S', self:getStorageValue(Storage.DangerousDepths.bosses.TheDukeOfTheDepths)) .."]")
else
window:addChoice("The Duke Of The Depths [ON]")
end


window:addChoice("-----------------------")
window:addChoice("-- Forgotten Knowledge --")

if self:getStorageValue(Storage.ForgottenKnowledge.LadyTenebrisTimer) > os.time() then
window:addChoice("Lady Tenebris [" .. os.date('%d/%m/%Y - %H:%M:%S', self:getStorageValue(Storage.ForgottenKnowledge.LadyTenebrisTimer)) .."]")
else
window:addChoice("Lady Tenebris [ON]")
end

if self:getStorageValue(Storage.ForgottenKnowledge.LloydTimer) > os.time() then
window:addChoice("Lloyd [" .. os.date('%d/%m/%Y - %H:%M:%S', self:getStorageValue(Storage.ForgottenKnowledge.LloydTimer)) .."]")
else
window:addChoice("Lloyd [ON]")
end

if self:getStorageValue(Storage.ForgottenKnowledge.ThornKnightTimer) > os.time() then
window:addChoice("Mounted Thorn Knight [" .. os.date('%d/%m/%Y - %H:%M:%S', self:getStorageValue(Storage.ForgottenKnowledge.ThornKnightTimer)) .."]")
else
window:addChoice("Mounted Thorn Knight [ON]")
end

if self:getStorageValue(Storage.ForgottenKnowledge.DragonkingTimer) > os.time() then
window:addChoice("Dragonking Zyrtarch [" .. os.date('%d/%m/%Y - %H:%M:%S', self:getStorageValue(Storage.ForgottenKnowledge.DragonkingTimer)) .."]")
else
window:addChoice("Dragonking Zyrtarch [ON]")
end

if self:getStorageValue(Storage.ForgottenKnowledge.HorrorTimer) > os.time() then
window:addChoice("Melting Frozen Horror [" .. os.date('%d/%m/%Y - %H:%M:%S', self:getStorageValue(Storage.ForgottenKnowledge.HorrorTimer)) .."]")
else
window:addChoice("Melting Frozen Horror [ON]")
end

if self:getStorageValue(Storage.ForgottenKnowledge.TimeGuardianTimer) > os.time() then
window:addChoice("The Time Guardian [" .. os.date('%d/%m/%Y - %H:%M:%S', self:getStorageValue(Storage.ForgottenKnowledge.TimeGuardianTimer)) .."]")
else
window:addChoice("The Time Guardian [ON]")
end

if self:getStorageValue(Storage.ForgottenKnowledge.LastLoreTimer) > os.time() then
window:addChoice("The Last Lore Keeper [" .. os.date('%d/%m/%Y - %H:%M:%S', self:getStorageValue(Storage.ForgottenKnowledge.LastLoreTimer)) .."]")
else
window:addChoice("The Last Lore Keeper [ON]")
end


window:addChoice("-----------------------")
window:addChoice("-- Bosses --")

if self:getStorageValue(Storage.GraveDanger.kingzelosTimer) > os.time() then
window:addChoice("King Zelos [" .. os.date('%d/%m/%Y - %H:%M:%S', self:getStorageValue(Storage.GraveDanger.kingzelosTimer)) .."]")
else
window:addChoice("King Zelos [ON]")
end

-- Send the window to player
window:sendToPlayer(self)
end


if you had some advice here would be awesome :D
 
Last edited:
Top