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

Action [Advanced] Rune(s) System

Status
Not open for further replies.
Change:
Lua:
local name = getItemNameById(2268)
To:
Lua:
local name = getItemName(2268)

You don't need to add stuff to global.
 
Im only fimilar to mapping in ot, started yasterday to try host one,
Where shall i add those lua files? and When i did? Where you buy the runes?
 
@Up,

Actions folder.
This script is when you use a lever, or item, it gives a bp of runes.
 
is possible make this script that work with more thant one lever?, something like:

UID: 1 = bp+20 sd runes
UID: 2 = bp+20 uh runes

and etc, 'cause i dont want add one by one :p


Anyway rep++ to you
 
Updated First Post.
New script added :cool: :thumbup:
 
Thanks for multi bps/levers!!! <3


Edit:
[24/07/2009 00:15:47] Lua Script Error: [Test Interface]
[24/07/2009 00:15:47] data/actions/scripts/rune.lua

[24/07/2009 00:15:47] data/actions/scripts/rune.lua:8: attempt to index global 'item' (a nil value)
[24/07/2009 00:15:47] Warning: [Event::checkScript] Can not load script. /scripts/rune.lua
 
Last edited:
When i am using the levers nothing happends, no error or anything.
 
Last edited:
Changed two things; it should work now.
 
My Errors:
Using Chronic Elements (0.2.4) (8.5)

[04/08/2009 17:19:53] Lua Script Error: [Test Interface]
[04/08/2009 17:19:53] data/actions/scripts/custom/bpsofitems.lua

[04/08/2009 17:19:53] data/actions/scripts/custom/bpsofitems.lua:29: attempt to index global 'item' (a nil value)
[04/08/2009 17:19:53] Warning: [Event::checkScript] Can not load script. /scripts/custom/bpsofitems.lua

Line 29:
local name = getItemNameById(config[item.uniqueid].item_id) -- Do not edit this.
 
I changed something, you can test it now.
Tell me if there are other errors.
 
Tested:
[04/08/2009 17:04:10] Lua Script Error: [Test Interface]
[04/08/2009 17:04:10] data/actions/scripts/custom/bpsofitems.lua

[04/08/2009 17:04:10] data/actions/scripts/custom/bpsofitems.lua:28: attempt to index field '?' (a nil value)
[04/08/2009 17:04:10] Warning: [Event::checkScript] Can not load script. /scripts/custom/bpsofitems.lua

Line 28:
local name = getItemNameById(config[uniqueid].item_id) -- Do not edit this.
 
This was tested on TFS 0.3 :thumbup:
 
Still not working - i'm using cryingdamson4pl2

[05/08/2009 21:04:33] Lua Script Error: [Action Interface]
[05/08/2009 21:04:33] data/actions/scripts/poty.lua

[05/08/2009 21:04:33] data/actions/scripts/poty.lua:22: attempt to index global 'item' (a nil value)
[05/08/2009 21:04:33] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/poty.lua)
[05/08/2009 21:04:33] cannot open data/actions/scripts/poty.lua: No such file or directory

-- This is the problem:
local name = getItemNameById(config[item.uniqueid].item_id) -- Do not edit this.

Any Help?
@Down
Omg... ^^ this is the error not this file...I know it's sey's "No such file of directory" but it's good i just dont reload actions ;p

@down
He don't see
(config[item.uniqueid].item_id)
[06/08/2009 11:24:17] data/actions/scripts/poty.lua:9: attempt to index field '?' (a nil value)
 
Last edited:
@Up,
Code:
[05/08/2009 21:04:33] cannot open data/actions/scripts/poty.lua: No such file or directory

You don't even have the file in the right place.

@Topic,
Updated again, but I cannot test it.
I also added another way to have charges to runes.

Good Luck :thumbup:
 
Was happy when I used updated version. No errors in console!

But then when I use the levers:
[06/08/2009 20:56:20] Lua Script Error: [Action Interface]
[06/08/2009 20:56:20] data/actions/scripts/custom/bpsofitems.lua:eek:nUse

[06/08/2009 20:56:20] data/actions/scripts/custom/bpsofitems.lua:29: attempt to index field '?' (a nil value)
[06/08/2009 20:56:20] stack traceback:
[06/08/2009 20:56:20] data/actions/scripts/custom/bpsofitems.lua:29: in function <data/actions/scripts/custom/bpsofitems.lua:28>

Lines 28 & 29:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local name = getItemNameById(cfg[item.uniqueid].item_id)

Thanks for support - keep making it better - I'll be more than happy to test all ur scripts u release...
 
Ejemm

Fixed script tested on Crying Damson 0.3.4 PL2

CONFIG
Lua:
-- [4040] = Switch ActionID
-- Item = Item that will fill the backpack
-- TotalCost = Cost of BP with items
-- Charges = Charges of runes (if in backpack, so, if you're going to put some equipment,etc.. put 1)

TO ADD AN SWITCH ONLY ADD ON:
Lua:
local palancas

Lua:
[SWITCH ACTIONID] = {item = ID OF ITEM IN BACKPACK, totalcost = COST OF BP WITH ITEMS, charges = Charges of runes (if in backpack, so, if you're going to put some equipment,etc.. put 1)},
Lua:
-- Sistema Perfeccionado de Compra de Items por BP
-- Made By AndresPro abbysteam.com)
-- Visitanos : abbysteam.com/opentibia
 
function onUse(cid, item, frompos, item2, topos)
-- Configuracion
local palancas = {
[2800] = {item = 2273, totalcost = 3020, charges = 1},
}
-- [4040] = Es el actionid del item
-- Item = es el ID del item que se dara al usar la palanca
-- TotalCost = es el precio por toda la bp
-- Charges = son las cargas que se daran para cada item
 
    if palancas[item.actionid] then
	local cosas = palancas[item.actionid]
	if getPlayerMoney(cid) >= cosas.totalcost then
	doPlayerRemoveMoney(cid, cosas.totalcost)
		doCreatureSay(cid, "CONGRATULATIONS! You bought a backpack with some items. ", TALKTYPE_ORANGE_1)
	local labp = doPlayerAddItem(cid, 2002)
	doAddContainerItem(labp, cosas.item, cosas.charges)
	doAddContainerItem(labp, cosas.item, cosas.charges)
	doAddContainerItem(labp, cosas.item, cosas.charges)
	doAddContainerItem(labp, cosas.item, cosas.charges)
	doAddContainerItem(labp, cosas.item, cosas.charges)
	doAddContainerItem(labp, cosas.item, cosas.charges)
	doAddContainerItem(labp, cosas.item, cosas.charges)
	doAddContainerItem(labp, cosas.item, cosas.charges)
	doAddContainerItem(labp, cosas.item, cosas.charges)
	doAddContainerItem(labp, cosas.item, cosas.charges)
	doAddContainerItem(labp, cosas.item, cosas.charges)
	doAddContainerItem(labp, cosas.item, cosas.charges)
	doAddContainerItem(labp, cosas.item, cosas.charges)
	doAddContainerItem(labp, cosas.item, cosas.charges)
	doAddContainerItem(labp, cosas.item, cosas.charges)
	doAddContainerItem(labp, cosas.item, cosas.charges)
	doAddContainerItem(labp, cosas.item, cosas.charges)
	doAddContainerItem(labp, cosas.item, cosas.charges)
	doAddContainerItem(labp, cosas.item, cosas.charges)
	doAddContainerItem(labp, cosas.item, cosas.charges)
	else
	doCreatureSay(cid, "You don't have money to buy. Required: ".. cosas.totalcost.." gold coins. ", TALKTYPE_ORANGE_1)
	end
	end
	return 1
	end
 
Status
Not open for further replies.
Back
Top