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

Compiling server without 'mods' folder

adahum

New Member
Joined
Feb 28, 2015
Messages
23
Reaction score
3
hi guys,

i've compiled theforgothen server 1.2 and its come without 'mods' folder. how can i put it ?
 
has something to replace? because i've an script that check if user is an battle all time. and i dont know how to do it without mods.
 
--here my code. that was in mods/

Code:
--here my code. that was in mods/

<?xml version="1.0" encoding="UTF-8"?>
    <mod name="healFunc" version="1.0" author="Adahox" contact="[email protected]" enabled="yes">
    <config name="healFunc"><![CDATA[

    char = {
        HEAL_SAFE = 0,
        SPELL_SAFE = ""
    }

    function healPlayer(cid, current_hp)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "current HP: "..current_hp.." => ".. char.HEAL_SAFE )
        if current_hp < char.HEAL_SAFE then
            say("Local Chat", char.SPELL_SAFE)
        end
    end

    function setHealSafe(value, cid)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "setHealSafe() called." )
        if value  then
            char.HEAL_SAFE = value
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "char.HEAL_SAFE = ".. tostring(value) )
        end
    end

    function setSpellSafe(value,cid)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "setSpellSafe() called." )
        if value then
            char.SPELL_SAFE = tostring(value)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "char.SPELL_SAFE = ".. tostring(value) )
        end
    end


    ]]></config>
    <event type="login" name="LootLogin" event="script"><![CDATA[
    function onLogin(cid)
        registerCreatureEvent(cid, "MonsterAttack")
        return true
    end]]></event>
    <event type="death" name="LootEventDeath" event="script"><![CDATA[
    domodlib('Loot_func')
    function onDeath(cid, corpse, deathList)
        local killer,pos = deathList[1],getCreaturePosition(cid)
        addEvent(corpseRetireItems,1,killer,pos)
        return true
    end]]></event>
    <event type="combat" name="MonsterAttack" event="script"><![CDATA[
    domodlib('healFunc')
    if isPlayer(cid) then
        local current_hp = getCreatureHealth(cid)
        addEvent(healPlayer,1, cid, current_hp)
    end
    return true]]></event>
    <talkaction words="!autoheal;/autoheal" event="buffer">
    <![CDATA[
        domodlib('healFunc')
        local t = string.explode(string.lower(param), " ")
        local strlen = table.getn(t) -- pega o tamanho do array.
   

        addEvent(setSpellSafe,1, t[strlen], cid)
        addEvent(setHealSafe,1, t[strlen - 1], cid)

        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "let's heal with "..t[strlen].." when my HP is above "..t[strlen - 1])
        return true
    ]]></talkaction>
    </mod>

my question is: how to check if the user is on battle all the time. and if its true, how can i check the user HP?
 
you don't
tfs 1.2 doesn't use mods, no server versions have used mods since 0.3.6

0.4 and 0.3.7 (A) :>

--here my code. that was in mods/

Code:
--here my code. that was in mods/

<?xml version="1.0" encoding="UTF-8"?>
    <mod name="healFunc" version="1.0" author="Adahox" contact="[email protected]" enabled="yes">
    <config name="healFunc"><![CDATA[

    char = {
        HEAL_SAFE = 0,
        SPELL_SAFE = ""
    }

    function healPlayer(cid, current_hp)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "current HP: "..current_hp.." => ".. char.HEAL_SAFE )
        if current_hp < char.HEAL_SAFE then
            say("Local Chat", char.SPELL_SAFE)
        end
    end

    function setHealSafe(value, cid)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "setHealSafe() called." )
        if value  then
            char.HEAL_SAFE = value
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "char.HEAL_SAFE = ".. tostring(value) )
        end
    end

    function setSpellSafe(value,cid)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "setSpellSafe() called." )
        if value then
            char.SPELL_SAFE = tostring(value)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "char.SPELL_SAFE = ".. tostring(value) )
        end
    end


    ]]></config>
    <event type="login" name="LootLogin" event="script"><![CDATA[
    function onLogin(cid)
        registerCreatureEvent(cid, "MonsterAttack")
        return true
    end]]></event>
    <event type="death" name="LootEventDeath" event="script"><![CDATA[
    domodlib('Loot_func')
    function onDeath(cid, corpse, deathList)
        local killer,pos = deathList[1],getCreaturePosition(cid)
        addEvent(corpseRetireItems,1,killer,pos)
        return true
    end]]></event>
    <event type="combat" name="MonsterAttack" event="script"><![CDATA[
    domodlib('healFunc')
    if isPlayer(cid) then
        local current_hp = getCreatureHealth(cid)
        addEvent(healPlayer,1, cid, current_hp)
    end
    return true]]></event>
    <talkaction words="!autoheal;/autoheal" event="buffer">
    <![CDATA[
        domodlib('healFunc')
        local t = string.explode(string.lower(param), " ")
        local strlen = table.getn(t) -- pega o tamanho do array.
  

        addEvent(setSpellSafe,1, t[strlen], cid)
        addEvent(setHealSafe,1, t[strlen - 1], cid)

        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "let's heal with "..t[strlen].." when my HP is above "..t[strlen - 1])
        return true
    ]]></talkaction>
    </mod>

my question is: how to check if the user is on battle all the time. and if its true, how can i check the user HP?


What you do is you split the mod, a mod file is actually just alot of scripts in one.
Take a look at this;
Lua:
    <talkaction words="!autoheal;/autoheal" event="buffer">
    <![CDATA[
        domodlib('healFunc')
        local t = string.explode(string.lower(param), " ")
        local strlen = table.getn(t) -- pega o tamanho do array.
 

        addEvent(setSpellSafe,1, t[strlen], cid)
        addEvent(setHealSafe,1, t[strlen - 1], cid)

        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "let's heal with "..t[strlen].." when my HP is above "..t[strlen - 1])
        return true
    ]]></talkaction>

What we need to do is create a Lua file in talkactions named autoheal.lua, make the healFunc config global (ex global.lua or a new lib file).
Then register the script in talkactions.xml.

Do that with everything, restart the server and look for bugs, read what they say I can see right now you are missing function onSay(...) and the end.
 
0.4 and 0.3.7 (A) :>




What you do is you split the mod, a mod file is actually just alot of scripts in one.
Take a look at this;
Lua:
    <talkaction words="!autoheal;/autoheal" event="buffer">
    <![CDATA[
        domodlib('healFunc')
        local t = string.explode(string.lower(param), " ")
        local strlen = table.getn(t) -- pega o tamanho do array.
 

        addEvent(setSpellSafe,1, t[strlen], cid)
        addEvent(setHealSafe,1, t[strlen - 1], cid)

        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "let's heal with "..t[strlen].." when my HP is above "..t[strlen - 1])
        return true
    ]]></talkaction>

What we need to do is create a Lua file in talkactions named autoheal.lua, make the healFunc config global (ex global.lua or a new lib file).
Then register the script in talkactions.xml.

Do that with everything, restart the server and look for bugs, read what they say I can see right now you are missing function onSay(...) and the end.
i do not remember mods being in 0.4 o.o
 
0.4 and 0.3.7 (A) :>




What you do is you split the mod, a mod file is actually just alot of scripts in one.
Take a look at this;
Lua:
    <talkaction words="!autoheal;/autoheal" event="buffer">
    <![CDATA[
        domodlib('healFunc')
        local t = string.explode(string.lower(param), " ")
        local strlen = table.getn(t) -- pega o tamanho do array.
 

        addEvent(setSpellSafe,1, t[strlen], cid)
        addEvent(setHealSafe,1, t[strlen - 1], cid)

        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "let's heal with "..t[strlen].." when my HP is above "..t[strlen - 1])
        return true
    ]]></talkaction>

What we need to do is create a Lua file in talkactions named autoheal.lua, make the healFunc config global (ex global.lua or a new lib file).
Then register the script in talkactions.xml.

Do that with everything, restart the server and look for bugs, read what they say I can see right now you are missing function onSay(...) and the end.


can u explain better? i not undestand what u said
 
can u explain better? i not undestand what u said

Well in short words you need to split the file into files.
Insted of having a talkactions script (the one I copied) you make a talkactions script in data/talkactions/scripts and then include it in talkactions.xml.
 
Well in short words you need to split the file into files.
Insted of having a talkactions script (the one I copied) you make a talkactions script in data/talkactions/scripts and then include it in talkactions.xml.

ya this part i undestand.
but, i need, for example, the script checks everytime if the user is in an battle and if return "true", the script should send an say() with healling spell.
talkactions run only when user say the special words. and i need the script runs "all the time"
 
ya this part i undestand.
but, i need, for example, the script checks everytime if the user is in an battle and if return "true", the script should send an say() with healling spell.
talkactions run only when user say the special words. and i need the script runs "all the time"

If you want it do be done then this should be moved to requests, this is a support forum where we can help you with certain issues.
So my tip is to try and rewrite it yourself, if you run into issues then write about them here.
 
Back
Top