• 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!

Bug Talkactions and GlobalEvents

Monomalo00

http://leiends.ml/
Joined
Nov 13, 2010
Messages
120
Solutions
1
Reaction score
4
Hi guys this is a bug :S
Lua:
[14/8/2013 20:44:46] [Error - Test Interface] 
[14/8/2013 20:44:46] data/actions/scripts/quests/annihilator.lua
[14/8/2013 20:44:46] Description: 
[14/8/2013 20:44:46] data/actions/scripts/quests/annihilator.lua:21: attempt to call global 'getBooleanFromString' (a nil value)
[14/8/2013 20:44:46] [Error - Event::checkScript] Cannot load script (data/actions/scripts/quests/annihilator.lua)


[14/8/2013 20:44:46] [Error - Test Interface] 
[14/8/2013 20:44:46] data/actions/scripts/tools/fishing.lua
[14/8/2013 20:44:46] Description: 
[14/8/2013 20:44:46] data/actions/scripts/tools/fishing.lua:33: attempt to call global 'getBooleanFromString' (a nil value)
[14/8/2013 20:44:46] [Error - Event::checkScript] Cannot load script (data/actions/scripts/tools/fishing.lua)


[14/8/2013 20:44:46] [Error - Test Interface] 
[14/8/2013 20:44:46] data/actions/scripts/tools/fishing.lua
[14/8/2013 20:44:46] Description: 
[14/8/2013 20:44:46] data/actions/scripts/tools/fishing.lua:33: attempt to call global 'getBooleanFromString' (a nil value)
[14/8/2013 20:44:46] [Error - Event::checkScript] Cannot load script (data/actions/scripts/tools/fishing.lua)


[14/8/2013 20:44:46] [Error - Test Interface] 
[14/8/2013 20:44:46] data/actions/scripts/liquids/potions.lua
[14/8/2013 20:44:46] Description: 
[14/8/2013 20:44:46] data/actions/scripts/liquids/potions.lua:10: attempt to call global 'getBooleanFromString' (a nil value)
[14/8/2013 20:44:46] [Error - Event::checkScript] Cannot load script (data/actions/scripts/liquids/potions.lua)

[14/8/2013 20:44:48] (done).
[14/8/2013 20:44:48] >>> Loading talkactions... [Error - LuaInterface::loadFile] cannot open data/talkactions/scripts/teleporttown.lua: No such file or directory
[14/8/2013 20:44:48] [Error - Event::checkScript] Cannot load script (data/talkactions/scripts/teleporttown.lua)
[14/8/2013 20:44:48] cannot open data/talkactions/scripts/teleporttown.lua: No such file or directory
[14/8/2013 20:44:48] [Error - LuaInterface::loadFile] cannot open data/talkactions/scripts/ban.lua: No such file or directory
[14/8/2013 20:44:48] [Error - Event::checkScript] Cannot load script (data/talkactions/scripts/ban.lua)
[14/8/2013 20:44:48] cannot open data/talkactions/scripts/ban.lua: No such file or directory

[14/8/2013 20:44:48] [Error - Test Interface] 
[14/8/2013 20:44:48] data/talkactions/scripts/frags.lua
[14/8/2013 20:44:48] Description: 
[14/8/2013 20:44:48] data/talkactions/scripts/frags.lua:2: attempt to call global 'getBooleanFromString' (a nil value)
[14/8/2013 20:44:48] [Error - Event::checkScript] Cannot load script (data/talkactions/scripts/frags.lua)


[14/8/2013 20:44:48] [Error - Test Interface] 
[14/8/2013 20:44:48] data/talkactions/scripts/online.lua
[14/8/2013 20:44:48] Description: 
[14/8/2013 20:44:48] data/talkactions/scripts/online.lua:2: attempt to call global 'getBooleanFromString' (a nil value)
[14/8/2013 20:44:48] [Error - Event::checkScript] Cannot load script (data/talkactions/scripts/online.lua)


[14/8/2013 20:44:48] [Error - Test Interface] 
[14/8/2013 20:44:48] data/talkactions/scripts/serverinfo.lua
[14/8/2013 20:44:48] Description: 
[14/8/2013 20:44:48] data/talkactions/scripts/serverinfo.lua:8: attempt to call global 'getBooleanFromString' (a nil value)
[14/8/2013 20:44:48] [Error - Event::checkScript] Cannot load script (data/talkactions/scripts/serverinfo.lua)


[14/8/2013 20:44:48] [Error - Test Interface] 
[14/8/2013 20:44:48] data/talkactions/scripts/commands.lua
[14/8/2013 20:44:48] Description: 
[14/8/2013 20:44:48] data/talkactions/scripts/commands.lua:2: attempt to call global 'getBooleanFromString' (a nil value)
[14/8/2013 20:44:48] [Error - Event::checkScript] Cannot load script (data/talkactions/scripts/commands.lua)

[14/8/2013 20:44:48] (done).
[14/8/2013 20:44:48] >>> Loading movements... (done).
[14/8/2013 20:44:50] >>> Loading creaturescripts... 
[14/8/2013 20:44:50] [Error - Test Interface] 
[14/8/2013 20:44:50] data/creaturescripts/scripts/login.lua
[14/8/2013 20:44:50] Description: 
[14/8/2013 20:44:50] data/creaturescripts/scripts/login.lua:3: attempt to call global 'getBooleanFromString' (a nil value)
[14/8/2013 20:44:50] [Error - Event::checkScript] Cannot load script (data/creaturescripts/scripts/login.lua)

[14/8/2013 20:44:50] (done).
[14/8/2013 20:44:50] >>> Loading globalscripts... 
[14/8/2013 20:44:50] [Error - Test Interface] 
[14/8/2013 20:44:50] data/globalevents/scripts/save.lua
[14/8/2013 20:44:50] Description: 
[14/8/2013 20:44:50] data/globalevents/scripts/save.lua:8: attempt to call global 'getBooleanFromString' (a nil value)
[14/8/2013 20:44:50] [Error - Event::checkScript] Cannot load script (data/globalevents/scripts/save.lua)

[14/8/2013 20:44:50] (done).
[14/8/2013 20:44:50] >> Loading monsters
[14/8/2013 20:44:50] >> Loading map and spawns:
[14/8/2013 20:44:50] >>> Map size: 1000x1000.
[14/8/2013 20:44:50] >>> Map descriptions: - "Saved with Remere's Map Editor 2.2" - "By Negrata"
[14/8/2013 20:44:50] >>> Loading time: 0.196 seconds.

[14/8/2013 20:44:50] [Error - NpcScript Interface] 
[14/8/2013 20:44:50] data/npc/scripts/loot.lua
[14/8/2013 20:44:50] Description: 
[14/8/2013 20:44:50] data/npc/lib/npcsystem/modules.lua:1107: attempt to call global 'getItemNameById' (a nil value)
[14/8/2013 20:44:50] [Warning - NpcEvents::NpcEvents] Cannot load script: data/npc/scripts/loot.lua
 
Add in 050-function.lua
Lua:
function getBooleanFromString(input)
	local tmp = type(input)
	if(tmp == 'boolean') then
		return input
	end

	if(tmp == 'number') then
		return input > 0
	end

	local str = string.lower(tostring(input))
	return (str == "yes" or str == "true" or (tonumber(str) ~= nil and tonumber(str) > 0))
end
 
you has fixed almost all bugs, have been other bugs.
Lua:
 [14/8/2013 21:25:8] data/npc/lib/npcsystem/modules.lua:1107: attempt to call global 'getItemNameById' (a nil value)
[14/8/2013 21:25:8] [Warning - NpcEvents::NpcEvents] Cannot load script: data/npc/scripts/loot.lua
and
Lua:
 [14/8/2013 21:25:21] Chetao has logged in.

[14/8/2013 21:25:21] [Error - CreatureScript Interface] 
[14/8/2013 21:25:21] data/creaturescripts/scripts/login.lua:onLogin
[14/8/2013 21:25:21] Description: 
[14/8/2013 21:25:21] data/lib/050-function.lua:218: attempt to call global 'getCreatureCondition' (a nil value)
[14/8/2013 21:25:21] stack traceback:
[14/8/2013 21:25:21] 	data/lib/050-function.lua:218: in function 'isPlayerGhost'
[14/8/2013 21:25:21] 	data/creaturescripts/scripts/login.lua:38: in function <data/creaturescripts/scripts/login.lua:6>
[14/8/2013 21:25:21] Chetao has logged out.
 
Lua:
function getItemNameById(itemid)
	return getItemDescriptionsById(itemid).name
end

getCreatureCondition should work in 0.3.6, so maybe it's set to a nil value, can you post your 100-combat.lua?
 
Lua:
function getItemNameById(itemid)
	return getItemDescriptionsById(itemid).name
end
where put that?

Lua:
--[[
 * File containing deprecated functions and constants used by alot of scripts and other engines
]]--
TRUE = true
FALSE = false
LUA_ERROR = false
LUA_NO_ERROR = true
LUA_NULL = nil

TALKTYPE_CHANNEL_R1 = TALKTYPE_CHANNEL_RN
TALKTYPE_CHANNEL_R2 = TALKTYPE_CHANNEL_RA
TALKTYPE_ORANGE_1 = TALKTYPE_MONSTER
TALKTYPE_ORANGE_2 = TALKTYPE_MONSTER_YELL

CONDITION_PARAM_STAT_MAXHITPOINTS = CONDITION_PARAM_STAT_MAXHEALTH
CONDITION_PARAM_STAT_MAXMANAPOINTS = CONDITION_PARAM_STAT_MAXMANA
CONDITION_PARAM_STAT_SOULPOINTS = CONDITION_PARAM_STAT_SOUL
CONDITION_PARAM_STAT_MAGICPOINTS = CONDITION_PARAM_STAT_MAGICLEVEL
CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT = CONDITION_PARAM_STAT_MAXHEALTHPERCENT
CONDITION_PARAM_STAT_MAXMANAPOINTSPERCENT = CONDITION_PARAM_STAT_MAXMANAPERCENT
CONDITION_PARAM_STAT_SOULPOINTSPERCENT = CONDITION_PARAM_STAT_SOULPERCENT
CONDITION_PARAM_STAT_MAGICPOINTSPERCENT = CONDITION_PARAM_STAT_MAGICLEVELPERCENT

STACKPOS_FIRST_ITEM_ABOVE_GROUNDTILE = 1
STACKPOS_SECOND_ITEM_ABOVE_GROUNDTILE = 2
STACKPOS_THIRD_ITEM_ABOVE_GROUNDTILE = 3
STACKPOS_FOURTH_ITEM_ABOVE_GROUNDTILE = 4
STACKPOS_FIFTH_ITEM_ABOVE_GROUNDTILE = 5

CHANNEL_STAFF = 2
CHANNEL_COUNSELOR = 4
CHANNEL_GAMECHAT = 5
CHANNEL_TRADE = 6
CHANNEL_TRADEROOK = 7
CHANNEL_RLCHAT = 8

BANTYPE_IP_BANISHMENT = 1
BANTYPE_NAMELOCK = 2
BANTYPE_BANISHMENT = 3
BANTYPE_NOTATION = 4
BANTYPE_DELETION = 3

SKILLS = SKILL_NAMES

table.getPos = table.find
doSetCreatureDropLoot = doCreatureSetDropLoot
doPlayerSay = doCreatureSay
doPlayerAddMana = doCreatureAddMana
playerLearnInstantSpell = doPlayerLearnInstantSpell
doPlayerRemOutfit = doPlayerRemoveOutfit
pay = doPlayerRemoveMoney
broadcastMessage = doBroadcastMessage
getPlayerName = getCreatureName
getCreaturePosition = getThingPosition
getPlayerPosition = getCreaturePosition
getCreaturePos = getCreaturePosition
creatureGetPosition = getCreaturePosition
getPlayerMana = getCreatureMana
getPlayerMaxMana = getCreatureMaxMana
hasCondition = getCreatureCondition
isMoveable = isMovable
isItemMoveable = isItemMovable
saveData = saveServer
savePlayers = saveServer
getPlayerSkill = getPlayerSkillLevel
getPlayerSkullType = getCreatureSkullType
getCreatureSkull = getCreatureSkullType
getAccountNumberByName = getAccountIdByName
getIPByName = getIpByName
getPlayersByIP = getPlayersByIp
getThingfromPos = getThingFromPos
getPlayersByAccountNumber = getPlayersByAccountId
getIPByPlayerName = getIpByName
getPlayersByIPNumber = getPlayersByIp
getAccountNumberByPlayerName = getAccountIdByName
convertIntToIP = doConvertIntegerToIp
convertIPToInt = doConvertIpToInteger
queryTileAddThing = doTileQueryAdd
getTileHouseInfo = getHouseFromPos
executeRaid = doExecuteRaid
saveServer = doSaveServer
cleanHouse = doCleanHouse
cleanMap = doCleanMap
shutdown = doShutdown
mayNotMove = doCreatureSetNoMove
doPlayerSetNoMove = doCreatureSetNoMove
getPlayerNoMove = getCreatureNoMove
getConfigInfo = getConfigValue
doPlayerAddExp = doPlayerAddExperience
isInArea = isInRange
doPlayerSetSkillRate = doPlayerSetRate
getCreatureLookDir = getCreatureLookDirection
getPlayerLookDir = getCreatureLookDirection
getPlayerLookDirection = getCreatureLookDirection
doCreatureSetLookDir = doCreatureSetLookDirection
getPlayerLookPos = getCreatureLookPosition
setPlayerStamina = doPlayerSetStamina
setPlayerPromotionLevel = doPlayerSetPromotionLevel
setPlayerGroupId = doPlayerSetGroupId
setPlayerPartner = doPlayerSetPartner
doPlayerSetStorageValue = doCreatureSetStorage
setPlayerStorageValue = doPlayerSetStorageValue
getPlayerStorageValue = getCreatureStorage
getGlobalStorageValue = getStorage
setGlobalStorageValue = doSetStorage
setPlayerBalance = doPlayerSetBalance
doAddMapMark = doPlayerAddMapMark
doSendTutorial = doPlayerSendTutorial
getWaypointsList = getWaypointList
getPlayerLastLoginSaved = getPlayerLastLogin
getThingPos = getThingPosition
doAreaCombatHealth = doCombatAreaHealth
doAreaCombatMana = doCombatAreaMana
doAreaCombatCondition = doCombatAreaCondition
doAreaCombatDispel = doCombatAreaDispel
getItemDescriptionsById = getItemInfo
hasProperty = hasItemProperty
hasClient = hasPlayerClient
print = std.cout
db.updateQueryLimitOperator = db.updateLimiter
db.stringComparisonOperator = db.stringComparison

PlayerFlag_CannotUseCombat = 0
PlayerFlag_CannotAttackPlayer = 1
PlayerFlag_CannotAttackMonster = 2
PlayerFlag_CannotBeAttacked = 3
PlayerFlag_CanConvinceAll = 4
PlayerFlag_CanSummonAll = 5
PlayerFlag_CanIllusionAll = 6
PlayerFlag_CanSenseInvisibility = 7
PlayerFlag_IgnoredByMonsters = 8
PlayerFlag_NotGainInFight = 9
PlayerFlag_HasInfiniteMana = 10
PlayerFlag_HasInfiniteSoul = 11
PlayerFlag_HasNoExhaustion = 12
PlayerFlag_CannotUseSpells = 13
PlayerFlag_CannotPickupItem = 14
PlayerFlag_CanAlwaysLogin = 15
PlayerFlag_CanBroadcast = 16
PlayerFlag_CanEditHouses = 17
PlayerFlag_CannotBeBanned = 18
PlayerFlag_CannotBePushed = 19
PlayerFlag_HasInfiniteCapacity = 20
PlayerFlag_CanPushAllCreatures = 21
PlayerFlag_CanTalkRedPrivate = 22
PlayerFlag_CanTalkRedChannel = 23
PlayerFlag_TalkOrangeHelpChannel = 24
PlayerFlag_NotGainExperience = 25
PlayerFlag_NotGainMana = 26
PlayerFlag_NotGainHealth = 27
PlayerFlag_NotGainSkill = 28
PlayerFlag_SetMaxSpeed = 29
PlayerFlag_SpecialVIP = 30
PlayerFlag_NotGenerateLoot = 31
PlayerFlag_CanTalkRedChannelAnonymous = 32
PlayerFlag_IgnoreProtectionZone = 33
PlayerFlag_IgnoreSpellCheck = 34
PlayerFlag_IgnoreWeaponCheck = 35
PlayerFlag_CannotBeMuted = 36
PlayerFlag_IsAlwaysPremium = 37
PlayerFlag_CanAnswerRuleViolations = 38
PlayerFlag_39 = 39 -- ignore
PlayerFlag_ShowGroupNameInsteadOfVocation = 40
PlayerFlag_HasInfiniteStamina = 41
PlayerFlag_CannotMoveItems = 42
PlayerFlag_CannotMoveCreatures = 43
PlayerFlag_CanReportBugs = 44
PlayerFlag_45 = 45 -- ignore
PlayerFlag_CannotBeSeen = 46

PlayerCustomFlag_AllowIdle = 0
PlayerCustomFlag_CanSeePosition	= 1
PlayerCustomFlag_CanSeeItemDetails = 2
PlayerCustomFlag_CanSeeCreatureDetails = 3
PlayerCustomFlag_NotSearchable = 4
PlayerCustomFlag_GamemasterPrivileges = 5
PlayerCustomFlag_CanThrowAnywhere = 6
PlayerCustomFlag_CanPushAllItems = 7
PlayerCustomFlag_CanMoveAnywhere = 8
PlayerCustomFlag_CanMoveFromFar = 9
PlayerCustomFlag_CanLoginMultipleCharacters = 10
PlayerCustomFlag_HasFullLight = 11
PlayerCustomFlag_CanLogoutAnytime = 12
PlayerCustomFlag_HideLevel = 13
PlayerCustomFlag_IsProtected = 14
PlayerCustomFlag_IsImmune = 15
PlayerCustomFlag_NotGainSkull = 16
PlayerCustomFlag_NotGainUnjustified = 17
PlayerCustomFlag_HideLevel = 18
PlayerCustomFlag_IgnorePacification = 19
PlayerCustomFlag_CanStairhop = 20
PlayerCustomFlag_CanTurnhop = 21
PlayerCustomFlag_IgnoreHouseRent = 22
 
Refresh!!

Error
Lua:
[14/8/2013 22:48:1] Chetao has logged in.

[14/8/2013 22:48:1] [Error - CreatureScript Interface] 
[14/8/2013 22:48:1] data/creaturescripts/scripts/login.lua:onLogin
[14/8/2013 22:48:1] Description: 
[14/8/2013 22:48:1] data/lib/050-function.lua:222: attempt to call global 'getCreatureCondition' (a nil value)
[14/8/2013 22:48:1] stack traceback:
[14/8/2013 22:48:1] 	data/lib/050-function.lua:222: in function 'isPlayerGhost'
[14/8/2013 22:48:1] 	data/creaturescripts/scripts/login.lua:38: in function <data/creaturescripts/scripts/login.lua:6>
[14/8/2013 22:48:1] Chetao has logged out.
 
Last edited:
Lua:
local config = {
	loginMessage = getConfigValue('loginMessage'),
	useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

function onLogin(cid)
	if(getBooleanFromString(getConfigValue('accountManager')) == false) then
		if (getCreatureName(cid) == "Account Manager") then
			return doRemoveCreature(cid, true)
		end
	end

	local loss = getConfigValue('deathLostPercent')
	if(loss ~= nil) then
		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
	end

	local accountManager = getPlayerAccountManager(cid)
	if(accountManager == MANAGER_NONE) then
		local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
		if(lastLogin > 0) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
			str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
		else
			str = str .. " Please choose your outfit."
			doPlayerSendOutfitWindow(cid)
		end

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
	elseif(accountManager == MANAGER_NAMELOCK) then
		addEvent(valid(doCreatureSay), 500, cid, "Hello, it appears that your character has been locked for name violating rules, what new name would you like to have?", TALKTYPE_PRIVATE_NP, true, cid)
	elseif(accountManager == MANAGER_ACCOUNT) then
		addEvent(valid(doCreatureSay), 500, cid, "Hello, type {account} to manage your account. If you would like to start over, type {cancel} anywhere.", TALKTYPE_PRIVATE_NP, true, cid)
	else
		addEvent(valid(doCreatureSay), 500, cid, "Hello, type {account} to create an account or {recover} to recover an account.", TALKTYPE_PRIVATE_NP, true, cid)
	end

	if(not isPlayerGhost(cid)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
	end

	registerCreatureEvent(cid, "Idle")
	registerCreatureEvent(cid, "Mail")
	if(getPlayerOperatingSystem(cid) >= CLIENTOS_OTCLIENT_LINUX) then
		registerCreatureEvent(cid, "ExtendedOpcode")
	end

	registerCreatureEvent(cid, "ReportBug")
	if(config.useFragHandler) then
		registerCreatureEvent(cid, "SkullCheck")
	end

	registerCreatureEvent(cid, "GuildEvents")
	registerCreatureEvent(cid, "AdvanceSave")
	registerCreatureEvent(cid, "recordIp")
	registerCreatureEvent(cid, "partyAndGuildProtection")
	
     registerCreatureEvent(cid, "kill")
     registerCreatureEvent(cid, "onPrepareDeath")
     registerCreatureEvent(cid, "PlayerLogout")
     registerCreatureEvent(cid, "onPrepareDeath")
	 registerCreatureEvent(cid, "KdrLook")
     registerCreatureEvent(cid, "killpoint")
     registerCreatureEvent(cid, "deathpoint")
	return true
end
 
You have added in 050-functions?
Lua:
function isPlayerGhost(cid)
	if(not isPlayer(cid)) then
		return false
	end

	return getCreatureCondition(cid, CONDITION_GAMEMASTER, GAMEMASTER_INVISIBLE) or getPlayerFlagValue(cid, PLAYERFLAG_CANNOTBESEEN)
end

I need see
your 050-function.lua for i can see what error have you
 
Try to replace this
Code:
function isPlayerGhost(cid)
        return isPlayer(cid) and (getCreatureCondition(cid, CONDITION_GAMEMASTER, GAMEMASTER_INVISIBLE, CONDITIONID_DEFAULT) or getPlayerFlagValue(cid, PLAYERFLAG_CANNOTBESEEN))
end
With this
Code:
function isPlayerGhost(cid)
   if(not isPlayer(cid)) then
     return false
   end

   return getCreatureCondition(cid, CONDITION_GAMEMASTER, GAMEMASTER_INVISIBLE) or getPlayerFlagValue(cid, PLAYERFLAG_CANNOTBESEEN)
end
 
nothing..
Code:
[6/9/2013 1:16:52] Chetao has logged in.

[6/9/2013 1:16:52] [Error - CreatureScript Interface]
[6/9/2013 1:16:52] data/creaturescripts/scripts/login.lua:onLogin
[6/9/2013 1:16:52] Description:
[6/9/2013 1:16:52] data/lib/050-function.lua:226: attempt to call global 'getCreatureCondition' (a nil value)
[6/9/2013 1:16:52] stack traceback:
[6/9/2013 1:16:52]    data/lib/050-function.lua:226: in function 'isPlayerGhost'
[6/9/2013 1:16:52]    data/creaturescripts/scripts/login.lua:38: in function <data/creaturescripts/scripts/login.lua:6>
[6/9/2013 1:16:52] Chetao has logged ou
 
Code:
function isPlayerGhost(cid)
    return isPlayer(cid) and (getCreatureConditionInfo(cid, CONDITION_GAMEMASTER, GAMEMASTER_INVISIBLE) or getPlayerFlagValue(cid, PLAYERFLAG_CANNOTBESEEN))
end

Just change all your getCreatureCondition to getCreatureConditionInfo ; Or simply add it to compat. :)
 
Back
Top