Eclipse
January 05, 2009, 07:48:17 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Chat Help Rules Arcade Search Calendar Gallery Login Register  
 
 
 
Recent Topics +-
Last one to post Wins by Hikaru
Today at 07:46:39 PM

Sig please :) by The BanHammer! [Thor!]
Today at 07:44:03 PM

The New Eclipse Raid on Runscape by ʇıunpp ʎqɹıʞ࣭
Today at 07:42:39 PM

Spike's Adminishness! by Marsh
Today at 07:36:56 PM

My Game by Sʎ|3><(_)z
Today at 07:36:22 PM

THE Cult by ‪‫‬‭‮‪‫‬‭The Admiral
Today at 07:34:15 PM

Server Issue by Xavi
Today at 07:33:20 PM

Azkanan's Workshop (Graphics) by Devogen
Today at 07:28:02 PM

New DezireSoft forums by The BanHammer! [Thor!]
Today at 07:27:15 PM

Makai Realms by Sʎ|3><(_)z
Today at 07:25:28 PM

Members Online +-
19 Guests, 19 Users
l0lz!,
Hikaru,
grenegg1,
Amperglyph,
Teh_General,
Echo ♥ Pie,
The BanHammer! [Thor!],
SoiWilliamSoi,
Sʎ|3><(_)z,
ʇıunpp ʎqɹıʞ࣭,
westin444,
Niko,
2guns,
‪‫‬‭‮‪‫‬‭The Admiral,
Marsh,
Dr. Who Cares,
Xavi,
Dimx,
Airscar
Pages: [1] 2
  Print  
Author Topic: Chest Script [1/5]  (Read 3314 times)
0 Members and 1 Guest are viewing this topic.
Godlord
Stephanus sum
Veteran
Teh Uberleet
*
Offline Offline

Posts: 4,109


View Profile WWW Email
« on: December 25, 2006, 10:10:33 AM »



This script is easy and maybe wanted? well I don't know but ok here it is  :wink:

Replace the whole sub(if not changed) Sub OnAttack(index) with:
Code: [Select]
Sub OnAttack(index)
Dim PX
Dim PY
Dim PM
Dim check
Dim itemcheck
Dim num
Dim val
PX = GetPlayerX(index)
PY = GetPlayerY(index)
PM = GetPlayerMap(index)
check = 1
itemcheck = 1
Do while check <= 9999
Do while itemcheck <= 24
If Int(PX + 1) = GetVar(App.Path & "Chest.ini", check, X) And PY = GetVar(App.Path & "Chest.ini", check, Y) And PM = GetVar(App.Path & "Chest.ini", check, MAP) Then
Call PlayerMsg(index, "You opened the chest.", 12)
num = GetVar(App.Path & "Chest.ini", check, "num")
val = GetVar(App.Path & "Chest.ini", check, "val")
If num = 0 Then
Call PlayerMsg(index, "There is nothing in the chest.", 12)
Exit Sub
Elseif GetPlayerInvNum(index, itemcheck) = 0 then
Call SetPlayerInvNum(index, itemcheck, num)
Call SetPlayerInvVal(index, itemcheck, val)
Call PlayerMsg(index, "You founded an item.", 12)
Else
Call PlayerMsg(index, "There is nothing in the chest.", 12)
Exit sub
End If
End If
If Int(PX - 1) = GetVar(App.Path & "Chest.ini", check, X) And PY = GetVar(App.Path & "Chest.ini", check, Y) And PM = GetVar(App.Path & "Chest.ini", check, MAP) Then
Call PlayerMsg(index, "You opened the chest.", 12)
num = GetVar(App.Path & "Chest.ini", check, "num")
val = GetVar(App.Path & "Chest.ini", check, "val")
If num = 0 Then
Call PlayerMsg(index, "There is nothing in the chest.", 12)
Exit Sub
Elseif GetPlayerInvNum(index, itemcheck) = 0 then
Call SetPlayerInvNum(index, itemcheck, num)
Call SetPlayerInvVal(index, itemcheck, val)
Call PlayerMsg(index, "You founded an item.", 12)
Else
Call PlayerMsg(index, "There is nothing in the chest.", 12)
Exit sub
End If
End If
If Int(PY + 1) = GetVar(App.Path & "Chest.ini", check, X) And PY = GetVar(App.Path & "Chest.ini", check, Y) And PM = GetVar(App.Path & "Chest.ini", check, MAP) Then
Call PlayerMsg(index, "You opened the chest.", 12)
num = GetVar(App.Path & "Chest.ini", check, "num")
val = GetVar(App.Path & "Chest.ini", check, "val")
If num = 0 Then
Call PlayerMsg(index, "There is nothing in the chest.", 12)
Exit Sub
Elseif GetPlayerInvNum(index, itemcheck) = 0 then
Call SetPlayerInvNum(index, itemcheck, num)
Call SetPlayerInvVal(index, itemcheck, val)
Call PlayerMsg(index, "You founded an item.", 12)
Else
Call PlayerMsg(index, "There is nothing in the chest.", 12)
Exit sub
End If
End If
If Int(PX + 1) = GetVar(App.Path & "Chest.ini", check, X) And PY = GetVar(App.Path & "Chest.ini", check, Y) And PM = GetVar(App.Path & "Chest.ini", check, MAP) Then
Call PlayerMsg(index, "You opened the chest.", 12)
num = GetVar(App.Path & "Chest.ini", check, "num")
val = GetVar(App.Path & "Chest.ini", check, "val")
If num = 0 Then
Call PlayerMsg(index, "There is nothing in the chest.", 12)
Exit Sub
Elseif GetPlayerInvNum(index, itemcheck) = 0 then
Call SetPlayerInvNum(index, itemcheck, num)
Call SetPlayerInvVal(index, itemcheck, val)
Call PlayerMsg(index, "You founded an item.", 12)
Else
Call PlayerMsg(index, "There is nothing in the chest.", 12)
Exit sub
End If
Else
Exit Sub
End If
Loop
Loop
End Sub

That should work well now the ini

Chest.ini
Code: [Select]
[1]
MAP=
X=
Y=
num=
val=
[2]
MAP=
X=
Y=
num=
val=
[1] 1 = the chest number. You can have 9999 chests with this script or if you change 9999 into the script then more.
num=0 is an empty chest. Other numbers are possible but it only can contain less or equal too your max items.
val=# # is how much of you want it into the chest. 0 is for non-stackable items.
MAP=# # is the map where the chest must be on.
X=# # is the X the chest must be on.
Y=# # is the Y the chest must be on.
Also you need to block that tile. Else the player can walk into the chest O.o.
Ctrl to open the chest and to get an item.
Have fun with your chests.

EDIT: Bug fixed normally, if more bugs appear then report.

EDIT2: Going to fix this whole script(re-making it and stuff :P)
l0lz!
I <3 Photoshop
Veteran
Advanced Eclipser
*
Online Online

Posts: 1,149



View Profile WWW Email
« Reply #1 on: December 25, 2006, 10:46:50 AM »

Very Nice, Good job Godlord  8-).
Godlord
Stephanus sum
Veteran
Teh Uberleet
*
Offline Offline

Posts: 4,109


View Profile WWW Email
« Reply #2 on: December 25, 2006, 10:52:15 AM »

No problem my next script are 5 skills. :-P (I work at christmas, Am I an elf?)
Ilnair
The Uber-Scriptor
Advanced Member
****
Offline Offline

Posts: 592


The Uber-Scriptor


View Profile WWW Email
« Reply #3 on: December 29, 2006, 01:22:57 PM »

Nice work ;).
Godlord
Stephanus sum
Veteran
Teh Uberleet
*
Offline Offline

Posts: 4,109


View Profile WWW Email
« Reply #4 on: December 29, 2006, 01:36:03 PM »

Thanks.
Chrono917
Active Member
***
Offline Offline

Posts: 138



View Profile Email
« Reply #5 on: January 01, 2007, 08:14:02 PM »

Wow Nice
KainBloodbane
Awesome Panda.
Active Member
***
Offline Offline

Posts: 261


Mapper Extrordinaire


View Profile WWW Email
« Reply #6 on: January 01, 2007, 08:46:43 PM »

Awesome dude, I'll prolly implement this into NOTD later :P
Sythja
Member
**
Offline Offline

Posts: 61


View Profile Email
« Reply #7 on: January 08, 2007, 05:36:10 PM »

err  is there a way mappers without direct access to my server files can make chests? cuz i really don't want to have to go and punch in all that info into the chest.ini myself, it would get in the way of the rest of the stuff i'm doing for it lol
Sythja
Member
**
Offline Offline

Posts: 61


View Profile Email
« Reply #8 on: January 10, 2007, 02:42:05 AM »

nvm then i'll find the answer elsewhere
Godlord
Stephanus sum
Veteran
Teh Uberleet
*
Offline Offline

Posts: 4,109


View Profile WWW Email
« Reply #9 on: January 10, 2007, 03:32:34 AM »

yes...  you need to use the Command Maker version 3.0 ;) btw. You need to input an X, Y and M position like /makechest M X Y and then it writes those coordininates into the INI file.
Sythja
Member
**
Offline Offline

Posts: 61


View Profile Email
« Reply #10 on: January 10, 2007, 01:13:11 PM »

got it, just not sure how to use it, i've been having so many problems with scripting its almost comical

almost
Wojtexx
Member
**
Offline Offline

Posts: 89


View Profile Email
« Reply #11 on: January 11, 2007, 03:58:55 PM »

Very good working script :)
Sythja
Member
**
Offline Offline

Posts: 61


View Profile Email
« Reply #12 on: January 12, 2007, 01:52:11 AM »

i must be doin something wrong cuz each time i add it i lose my commands, i type them in and get no response
The BanHammer! [Thor!]
DezireSoft
Veteran
Advanced Eclipser
*
Online Online

Posts: 1,657


DezireSoft


View Profile WWW Email
« Reply #13 on: January 12, 2007, 08:30:45 PM »

...Damn  :wave: this kicks ass thanks man
Godlord
Stephanus sum
Veteran
Teh Uberleet
*
Offline Offline

Posts: 4,109


View Profile WWW Email
« Reply #14 on: January 12, 2007, 08:32:02 PM »

no problem.
Fax
Hoplitai General
Active Member
***
Offline Offline

Posts: 184

Hahaha what?


View Profile WWW Email
« Reply #15 on: January 12, 2007, 08:33:52 PM »

It doesnt seem to be working. (I am using TE and I installed it correctly) but when I replace the on attack sub the whole main stops working. is there a error in it. also where do I place the chests.ini in the server folder or the scripts folder
Godlord
Stephanus sum
Veteran
Teh Uberleet
*
Offline Offline

Posts: 4,109


View Profile WWW Email
« Reply #16 on: January 12, 2007, 08:37:56 PM »

Server folder, lemme check. Maybe I scripted something wrong.
Fax
Hoplitai General
Active Member
***
Offline Offline

Posts: 184

Hahaha what?


View Profile WWW Email
« Reply #17 on: January 12, 2007, 08:38:31 PM »

awesome script though
Godlord
Stephanus sum
Veteran
Teh Uberleet
*
Offline Offline

Posts: 4,109


View Profile WWW Email
« Reply #18 on: January 12, 2007, 08:44:54 PM »

try again with the new code. If it still doesn't work then I probably know the problem.
Fax
Hoplitai General
Active Member
***
Offline Offline

Posts: 184

Hahaha what?


View Profile WWW Email
« Reply #19 on: January 12, 2007, 08:46:04 PM »

will do hold on
Pages: [1] 2
  Print  
 
 

Powered by EzPortal
Powered by MySQL Powered by PHP Powered by SMF 2.0 Beta 4 | SMF © 2006–2008, Simple Machines LLC | Sitemap Valid XHTML 1.0! Valid CSS!
Page created in 1.277 seconds with 32 queries.