TNET
English French German Spain Italian Dutch Russian Portuguese Japanese Korean Arabic Chinese Simplified

Wróć   Tibia.net.pl > OpenTibia > Skrypty - pozostałe > Pomoc

Odpowiedz


 
06-02-10, 14:07  
Dragonas
Delegat
 
Użytkownik Dragonas na Tibia.net.pl

Bardzo łatwe Za pomoc reput!


Witam, ostatnio napisałem skrypt który nie działa:

Co on ma robić:
Za pierwszym razem po naciśnięciu na dźwignie usuwa się ściana, za drugim naciśnięciem, usuwa się druga - inna ściana... I tak dalej .. Łącznie 10 ścian.
Przy każdym naciśnięciu na dźwignie pojawia się jakiś potwór.
Oto i co stworzyłem:
uid dźwigni na mapie: 4566
actionid dźwigni na mapie: 4573

shamans.lua:
Kod:
function onUse(cid, item, frompos, item2, topos)
pos1 = {x=362, y=615, z=9, stackpos=1}
pos2 = {x=358, y=610, z=9, stackpos=1}
pos3 = {x=359, y=610, z=9, stackpos=1}
pos4 = {x=360, y=610, z=9, stackpos=1}
pos5 = {x=361, y=610, z=9, stackpos=1}
pos6 = {x=361, y=612, z=9, stackpos=1}
pos7 = {x=330, y=612, z=9, stackpos=1}
pos8 = {x=359, y=612, z=9, stackpos=1}
pos9 = {x=358, y=612, z=9, stackpos=1}
pos10 = {x=357, y=612, z=9, stackpos=1}
mpos1 = {x=357, y=614, z=9}
mpos2 = {x=358, y=615, z=9}
mpos3 = {x=359, y=616, z=9}
mpos4 = {x=360, y=614, z=9}
mpos5 = {x=358, y=614, z=9}
getgate1 = getThingfromPos(pos1)
getgate2 = getThingfromPos(pos2)
getgate3 = getThingfromPos(pos3)
getgate4 = getThingfromPos(pos4)
getgate5 = getThingfromPos(pos5)
getgate6 = getThingfromPos(pos6)
getgate7 = getThingfromPos(pos7)
getgate8 = getThingfromPos(pos8)
getgate9 = getThingfromPos(pos9)
getgate10 = getThingfromPos(pos10)
item.uid = 4566
if item.actionid == 4573 and item.itemid == 1945 and getgate1.itemid == 1116 then
doRemoveItem(getgate1.uid,1)
doTransformItem(item.uid,item.itemid+1)
doSetItemActionId(Item.uid, 4574)
end
if item.actionid == 4574 and item.itemid == 1946 and getgate2.itemid == 1116 then
doRemoveItem(getgate2.uid,1)
	doSummonCreature("Hydra", mpos5)
doTransformItem(item.uid,item.itemid-1)
doSetItemActionId(Item.uid, 4575)
end
if item.actionid == 4575 and item.itemid == 1945 and getgate3.itemid == 1116 then
doRemoveItem(getgate3.uid,1)
	doSummonCreature("Hydra", mpos3)
doTransformItem(item.uid,item.itemid+1)
doSetItemActionId(Item.uid, 4576)
end
if item.actionid == 4576 and item.itemid == 1946 and getgate4.itemid == 1116 then
doRemoveItem(getgate4.uid,1)
	doSummonCreature("Hydra", mpos3)
	doSummonCreature("Hydra", mpos2)
doTransformItem(item.uid,item.itemid-1)
doSetItemActionId(Item.uid, 4577)
end
if item.actionid == 4577 and item.itemid == 1945 and getgate5.itemid == 1116 then
doRemoveItem(getgate5.uid,1)
	doSummonCreature("Hydra", mpos1)
doTransformItem(item.uid,item.itemid+1)
doSetItemActionId(Item.uid, 4578)
end
if item.actionid == 4578 and item.itemid == 1946 and getgate6.itemid == 1116 then
doRemoveItem(getgate6.uid,1)
	doSummonCreature("Serpent Spawn", mpos5)
	doSummonCreature("Hydra", mpos2)
doTransformItem(item.uid,item.itemid-1)
doSetItemActionId(Item.uid, 4579)
end
if item.actionid == 4579 and item.itemid == 1945 and getgate7.itemid == 1116 then
doRemoveItem(getgate7.uid,1)
	doSummonCreature("Medusa", mpos4)
	doSummonCreature("Hydra", mpos2)
	doSummonCreature("Basilisk", mpos3)
doTransformItem(item.uid,item.itemid+1)
doSetItemActionId(Item.uid,4580)
end
if item.actionid == 4580 and item.itemid == 1946 and getgate8.itemid == 1116 then
doRemoveItem(getgate8.uid,1)
	doSummonCreature("Hydra", mpos1)
	doSummonCreature("Hydra", mpos2)
	doSummonCreature("Hydra", mpos3)
	doSummonCreature("Medusa", mpos4)
	doSummonCreature("Medusa", mpos5)
doTransformItem(item.uid,item.itemid-1)
doSetItemActionId(Item.uid,4581)
end
if item.actionid == 4581 and item.itemid == 1945 and getgate9.itemid == 1116 then
doRemoveItem(getgate9.uid,1)
	doSummonCreature("Dragon Lord", mpos1)
	doSummonCreature("Dragon Lord", mpos5)
	doSummonCreature("Dragon Lord", mpos3)
doTransformItem(item.uid,item.itemid+1)
doSetItemActionId(Item.uid,4582)
end
if item.actionid == 4582 and item.itemid == 1946 and getgate10.itemid == 1116 then
doRemoveItem(getgate10.uid,1)
	doSummonCreature("Dragon Lord", mpos5)
	doSummonCreature("Dragon", mpos2)
	doSummonCreature("Dragon", mpos4)
doTransformItem(item.uid,item.itemid-1)
doSetItemActionId(Item.uid,4583)
else
doPlayerSendCancel(cid,"Sorry not possible.")
end
  return 1
  end


action.xml:

Kod:
<action actionid="4573" script="shamans.lua" />
<action actionid="4574" script="shamans.lua" />
<action actionid="4575" script="shamans.lua" />
<action actionid="4576" script="shamans.lua" />
<action actionid="4577" script="shamans.lua" />
<action actionid="4578" script="shamans.lua" />
<action actionid="4579" script="shamans.lua" />
<action actionid="4580" script="shamans.lua" />
<action actionid="4581" script="shamans.lua" />
<action actionid="4582" script="shamans.lua" />
<action uniqueid="4566" script="shamans.lua" />

A błąd który pojawia się w konsolce to:
Kod:
[06/02/2010 13:34:12] [Error - Action Interface] 
[06/02/2010 13:34:12] data/actions/scripts/shamans.lua:onUse
[06/02/2010 13:34:12] Description: 
[06/02/2010 13:34:12] data/actions/scripts/shamans.lua:34: attempt to index global 'Item' (a nil value)
[06/02/2010 13:34:12] stack traceback:
[06/02/2010 13:34:12] 	data/actions/scripts/shamans.lua:34: in function <data/actions/scripts/shamans.lua:1>
Proszę o pomoc. Najprawdopodobniej(wg mnie) nie działa przez to:
Kod:
doSetItemActionId(Item.uid,4581)
Ale nie wiem czemu. ;/
Proszę o pomoc!

PS: Korzystam z tfs 0.3.6.
 
Linki sponsorowane
Adwert
Informator
Grasz?

06-02-10, 15:53  
Ldrozd
Przewodniczący
 
Użytkownik Ldrozd na Tibia.net.pl

Odp: Bardzo łatwe Za pomoc reput!


Skoro przez to:
Kod:
doSetItemActionId(Item.uid,4581)
To wklej to
data/lib/050-function.lua na koncu:
Kod:
function doSetItemActionId(lols, actionid)
return doItemSetAttribute(lols, "aid", actionid)
end
Tej funkcji juz nie ma w 0.3.6, a ja sprawilem, ze ona wrocila :rotfl:
 
06-02-10, 21:24  
Dragonas
Delegat
 
Użytkownik Dragonas na Tibia.net.pl

Odp: Bardzo łatwe Za pomoc reput!


Nadal potrzebuje pomocy!
#up A co to wg znaczy to 'lols'? Mam to na coś zmienić?
I tak dostajesz reputka!

I czekają inni! Proszę o pomoc!
 
08-02-10, 12:18  
Dragonas
Delegat
 
Użytkownik Dragonas na Tibia.net.pl

Odp: Bardzo łatwe Za pomoc reput!


Refresh !!! Błagam pomóżcie!
 
08-02-10, 14:14  
Doman08
.konkretna wyjebka
 
Użytkownik Doman08 na Tibia.net.pl

Odp: Bardzo łatwe Za pomoc reput!


Kod:
doSetItemActionId(Item.uid,4581)
Zmień na:
Kod:
doItemSetAttribute(Item.uid, "aid", 4581)
 
08-02-10, 14:32  
Tairens
Jedna miłość!

Odp: Bardzo łatwe Za pomoc reput!


Zmień wszędzie gdzie jest
Kod:
Item
Na
Kod:
item
 
08-02-10, 15:08  
Ldrozd
Przewodniczący
 
Użytkownik Ldrozd na Tibia.net.pl

Odp: Bardzo łatwe Za pomoc reput!


Cytat:
Napisał Doman08 Zobacz post
Kod:
doSetItemActionId(Item.uid,4581)
Zmień na:
Kod:
doItemSetAttribute(Item.uid, "aid", 4581)
Po co skoro dodalismy nowa funkcje!?:huh:
 
08-02-10, 15:20  
Doman08
.konkretna wyjebka
 
Użytkownik Doman08 na Tibia.net.pl

Odp: Bardzo łatwe Za pomoc reput!


Cytat:
Napisał Dragonas Zobacz post
Nadal potrzebuje pomocy!
#up A co to wg znaczy to 'lols'? Mam to na coś zmienić?
I tak dostajesz reputka!
Cytat:
Napisał Ldrozd Zobacz post
Po co skoro dodalismy nowa funkcje!?
Skąd wiesz, że dodał? Widzisz to? Nie kumał tego lols, a Ty mu nie wytłumaczyłeś, więc szuka dalej.
Kod PHP:
function onUse(ciditemfrompositem2topos)
pos1 = {x=362y=615z=9stackpos=1}
pos2 = {x=358y=610z=9stackpos=1}
pos3 = {x=359y=610z=9stackpos=1}
pos4 = {x=360y=610z=9stackpos=1}
pos5 = {x=361y=610z=9stackpos=1}
pos6 = {x=361y=612z=9stackpos=1}
pos7 = {x=330y=612z=9stackpos=1}
pos8 = {x=359y=612z=9stackpos=1}
pos9 = {x=358y=612z=9stackpos=1}
pos10 = {x=357y=612z=9stackpos=1}
mpos1 = {x=357y=614z=9}
mpos2 = {x=358y=615z=9}
mpos3 = {x=359y=616z=9}
mpos4 = {x=360y=614z=9}
mpos5 = {x=358y=614z=9}
getgate1 getThingfromPos(pos1)
getgate2 getThingfromPos(pos2)
getgate3 getThingfromPos(pos3)
getgate4 getThingfromPos(pos4)
getgate5 getThingfromPos(pos5)
getgate6 getThingfromPos(pos6)
getgate7 getThingfromPos(pos7)
getgate8 getThingfromPos(pos8)
getgate9 getThingfromPos(pos9)
getgate10 getThingfromPos(pos10)
item.uid 4566
if item.actionid == 4573 and item.itemid == 1945 and getgate1.itemid == 1116 then
doRemoveItem
(getgate1.uid,1)
doTransformItem(item.uid,item.itemid+1)
doItemSetAttribute(item.uid"aid"4574)
end
if item.actionid == 4574 and item.itemid == 1946 and getgate2.itemid == 1116 then
doRemoveItem
(getgate2.uid,1)
    
doSummonCreature("Hydra"mpos5)
doTransformItem(item.uid,item.itemid-1)
doItemSetAttribute(item.uid"aid",  4575)
end
if item.actionid == 4575 and item.itemid == 1945 and getgate3.itemid == 1116 then
doRemoveItem
(getgate3.uid,1)
    
doSummonCreature("Hydra"mpos3)
doTransformItem(item.uid,item.itemid+1)
doItemSetAttribute(item.uid"aid"4576)
end
if item.actionid == 4576 and item.itemid == 1946 and getgate4.itemid == 1116 then
doRemoveItem
(getgate4.uid,1)
    
doSummonCreature("Hydra"mpos3)
    
doSummonCreature("Hydra"mpos2)
doTransformItem(item.uid,item.itemid-1)
doItemSetAttribute(item.uid"aid"4577)
end
if item.actionid == 4577 and item.itemid == 1945 and getgate5.itemid == 1116 then
doRemoveItem
(getgate5.uid,1)
    
doSummonCreature("Hydra"mpos1)
doTransformItem(item.uid,item.itemid+1)
doItemSetAttribute(item.uid"aid"4578)
end
if item.actionid == 4578 and item.itemid == 1946 and getgate6.itemid == 1116 then
doRemoveItem
(getgate6.uid,1)
    
doSummonCreature("Serpent Spawn"mpos5)
    
doSummonCreature("Hydra"mpos2)
doTransformItem(item.uid,item.itemid-1)
doItemSetAttribute(item.uid"aid"4579)
end
if item.actionid == 4579 and item.itemid == 1945 and getgate7.itemid == 1116 then
doRemoveItem
(getgate7.uid,1)
    
doSummonCreature("Medusa"mpos4)
    
doSummonCreature("Hydra"mpos2)
    
doSummonCreature("Basilisk"mpos3)
doTransformItem(item.uid,item.itemid+1)
doItemSetAttribute(item.uid"aid"4580)
end
if item.actionid == 4580 and item.itemid == 1946 and getgate8.itemid == 1116 then
doRemoveItem
(getgate8.uid,1)
    
doSummonCreature("Hydra"mpos1)
    
doSummonCreature("Hydra"mpos2)
    
doSummonCreature("Hydra"mpos3)
    
doSummonCreature("Medusa"mpos4)
    
doSummonCreature("Medusa"mpos5)
doTransformItem(item.uid,item.itemid-1)
doItemSetAttribute(item.uid"aid"4581)
end
if item.actionid == 4581 and item.itemid == 1945 and getgate9.itemid == 1116 then
doRemoveItem
(getgate9.uid,1)
    
doSummonCreature("Dragon Lord"mpos1)
    
doSummonCreature("Dragon Lord"mpos5)
    
doSummonCreature("Dragon Lord"mpos3)
doTransformItem(item.uid,item.itemid+1)
doItemSetAttribute(item.uid"aid"4582)
end
if item.actionid == 4582 and item.itemid == 1946 and getgate10.itemid == 1116 then
doRemoveItem
(getgate10.uid,1)
    
doSummonCreature("Dragon Lord"mpos5)
    
doSummonCreature("Dragon"mpos2)
    
doSummonCreature("Dragon"mpos4)
doTransformItem(item.uid,item.itemid-1)
doItemSetAttribute(item.uid"aid"4583)
else
doPlayerSendCancel(cid,"Sorry not possible.")
end
  
return 1
  end 
Coś takiego?
 
11-02-10, 21:42  
Dragonas
Delegat
 
Użytkownik Dragonas na Tibia.net.pl

Odp: Bardzo łatwe Za pomoc reput!


@up wytłumaczył notką. Dodałem to jakby co : ) Zaraz poprawie na to co mi napisaliście up. I dam edita.

@edit
Działa! Dzięki!
Doman08, reput for you!

PS:
Cytat:
w data/lib/050-function.lua na koncu:

Kod:
function doSetItemActionId(lols, actionid)
return doItemSetAttribute(lols, "aid", actionid)
end
To miałem i mam cały czas wklejone, więc to po prostu nie działa. Ale dzięki wszystkim za pomoc.

Temat do zamknięcia!
 


Odpowiedz

Narzędzia tematu
Wygląd


Tibia.net.pl: Pomoc (Miejsce na pomoc w utworzeniu skryptu.)
Temat: Bardzo łatwe Za pomoc reput! Witam, ostatnio napisałem skrypt który nie działa: Co on ma [...]


Magic Effect problem - mimi1990 (0) Dzisiaj 11:53 Manarune - pp108 (0) Dzisiaj 11:52 Wymienie Pokemon Online Sprity za Skrypty do PO - blaboss (2) Dzisiaj 12:30 Kompilowanie DevC++ 4.9.9.2 - kanciok94 (0) Wczoraj 15:04 tibiarules.php - Ceasar (2) Wczoraj 10:55


Czas w strefie GMT +2. Teraz jest 15:02.




Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.3.0 © 2009, Crawlability, Inc.
Tibia.net.pl 2007-2010