Eclipse
January 05, 2009, 09:08:38 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 +-
Which version of eclipse do you like most for sadscripting? by Kainan54
Today at 09:08:20 PM

Disparity Recruiting by Peter
Today at 09:07:21 PM

The New Eclipse Raid on Runscape by Kreator
Today at 09:03:57 PM

Dreadlord Online v1.2 Beta - Need Moderators and Trustworthy Mappers! by Kreator
Today at 09:02:38 PM

[$$] Paying Paypal - GFX artists [$$] by Ninja-Tech
Today at 09:00:27 PM

SnowCap by The Tribal
Today at 09:00:01 PM

THE Cult by The Tribal
Today at 08:49:34 PM

Teh Cult by Simius Cruentus
Today at 08:44:15 PM

Makai Realms by kira423
Today at 08:41:25 PM

My Game by Kreator
Today at 08:40:25 PM

Members Online +-
15 Guests, 17 Users
‪‫‬‭‮‪‫Kusy,
‪‫‬‭‮‪‫‬‭The Admiral,
Peter,
Kainan54,
HawkStorm95,
kira423,
Munro,
Amperglyph,
The Troy,
The Roujo,
Kreator,
DarkMazer,
ralir,
Ambard,
Ninja-Tech,
The Tribal,
westin444
Pages: [1]
  Print  
Author Topic: Script Submission: Save Script (difficulty 1/5)  (Read 1958 times)
0 Members and 1 Guest are viewing this topic.
Ilnair
The Uber-Scriptor
Advanced Member
****
Offline Offline

Posts: 592


The Uber-Scriptor


View Profile WWW Email
« on: September 29, 2006, 12:55:48 PM »



Hello,

This one was requested, and I did kinda have it. You can make a timer or a command to run it yourself. Note, it does NOT save the weapon/armor slot and such, I did this to prevent some errors I was having from server crashes, and it does NOT affect game play in any way (exept for the fact that you might have to reequip something on first relog after server crash).

Here you go:

Code: [Select]
Sub Save(index)
Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "NecklaceSlot" , "0")
Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "RingSlot" , "0")
Call PutVar("Banks\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "NecklaceSlot" , "0")
Call PutVar("Banks\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "RingSlot" , "0")
Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "Guild" , GetPlayerGuild(index))
Call PutVar("Banks\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "Guild" , GetPlayerGuild(index))

Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "EXP" , GetPlayerExp(Index))
Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "Class" , GetPlayerClass(Index))
Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "Sprite" , GetPlayerSprite(Index))
Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "ArmorSlot" , GetPlayerArmorSlot(Index))
Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "WeaponSlot" , GetPlayerWeaponSlot(Index))
Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "HelmetSlot" , GetPlayerHelmetSlot(Index))
Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "ShieldSlot" , GetPlayerShieldSlot(Index))
Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "Level" , GetPlayerLevel(Index))
Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "HP" , GetPlayerHP(Index))
Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "MP" , GetPlayerMP(Index))
Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "SP" , GetPlayerSP(Index))
Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "STR" , GetPlayerSTR(Index))
Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "DEF" , GetPlayerDEF(Index))
Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "SPEED" , GetPlayerSPEED(Index))
Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "MAGI" , GetPlayerMAGI(Index))
Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "POINTS" , GetPlayerPOINTS(Index))
Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "Map" , GetPlayerMap(Index))
Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "X" , GetPlayerX(Index))
Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "Y" , GetPlayerY(Index))
n = 1
Do While n < 25
Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini ", "CHAR" & GetPlayerCharNum(Index), "InvItemNum" & n, GetPlayerInvItemNum(Index, n))
Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini ", "CHAR" & GetPlayerCharNum(Index), "InvItemVal" & n, GetPlayerInvItemValue(Index, n))
Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini ", "CHAR" & GetPlayerCharNum(Index), "InvItemDur" & n, GetPlayerInvItemDur(Index, n))
n = n + 1
Loop
n = 1
Do While n < 21
Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini ", "CHAR" & GetPlayerCharNum(Index), "Spell" & n, GetPlayerSpell(Index, n))
n = n + 1
Loop
Call PutVar("banks\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "NecklaceSlot" , "0")
Call PutVar("banks\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "RingSlot" , "0")
Call PutVar("Banks\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "NecklaceSlot" , "0")
Call PutVar("Banks\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "RingSlot" , "0")
Call PutVar("banks\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "EXP" , GetPlayerExp(Index))
Call PutVar("banks\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "Class" , GetPlayerClass(Index))
Call PutVar("banks\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "Sprite" , GetPlayerSprite(Index))
Call PutVar("banks\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "ArmorSlot" , GetPlayerArmorSlot(Index))
Call PutVar("banks\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "WeaponSlot" , GetPlayerWeaponSlot(Index))
Call PutVar("banks\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "HelmetSlot" , GetPlayerHelmetSlot(Index))
Call PutVar("banks\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "ShieldSlot" , GetPlayerShieldSlot(Index))
Call PutVar("banks\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "Level" , GetPlayerLevel(Index))
Call PutVar("banks\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "HP" , GetPlayerHP(Index))
Call PutVar("banks\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "MP" , GetPlayerMP(Index))
Call PutVar("banks\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "SP" , GetPlayerSP(Index))
Call PutVar("banks\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "STR" , GetPlayerSTR(Index))
Call PutVar("banks\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "DEF" , GetPlayerDEF(Index))
Call PutVar("banks\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "SPEED" , GetPlayerSPEED(Index))
Call PutVar("banks\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "MAGI" , GetPlayerMAGI(Index))
Call PutVar("banks\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "POINTS" , GetPlayerPOINTS(Index))
Call PutVar("banks\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "Map" , GetPlayerMap(Index))
Call PutVar("banks\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "X" , GetPlayerX(Index))
Call PutVar("banks\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "Y" , GetPlayerY(Index))
n = 1
Do While n < 25
Call PutVar("banks\" & GetPlayerLogin(index) & ".ini ", "CHAR" & GetPlayerCharNum(Index), "InvItemNum" & n, GetPlayerInvItemNum(Index, n))
Call PutVar("banks\" & GetPlayerLogin(index) & ".ini ", "CHAR" & GetPlayerCharNum(Index), "InvItemVal" & n, GetPlayerInvItemValue(Index, n))
Call PutVar("banks\" & GetPlayerLogin(index) & ".ini ", "CHAR" & GetPlayerCharNum(Index), "InvItemDur" & n, GetPlayerInvItemDur(Index, n))
n = n + 1
Loop
n = 1
Do While n < 21
Call PutVar("banks\" & GetPlayerLogin(index) & ".ini ", "CHAR" & GetPlayerCharNum(Index), "Spell" & n, GetPlayerSpell(Index, n))
n = n + 1
Loop
End Sub

Just place that one on the bottom of your main.txt. Now go to your Sub Commands, and then find "Select Case LCase(Trim(TextSay))", without the "and" ofcourse. Right below it paste this:
Code: [Select]
Case "/save"
Call Save(index)
Exit Sub

If you want it to run every time you switch map, find Sub OnMapLoad(index), and right below that post:
Code: [Select]
Call Save(index)

Code: [Select]
'*****************************************************************
'*****************************************************************
'XX This script has been created by Ilnair, aka Dinand Mentink  XX
'XX Please do not give it out saying you made it, or distribute XX
'XX it anywhere outside the Eclipse forums! Also, please always XX
'XX distribute these credits along with the script! XX
'XX           www.nishansu.tk       ©Dinand Mentink (aka Ilnair)XX
'*****************************************************************
'*****************************************************************
DFAx
Guest


Email
« Reply #1 on: October 01, 2006, 07:19:31 AM »

thx, i was the 1 that needed but i already figured out how to implement it =)

sorry for your troubles xD
Ilnair
The Uber-Scriptor
Advanced Member
****
Offline Offline

Posts: 592


The Uber-Scriptor


View Profile WWW Email
« Reply #2 on: October 01, 2006, 08:29:29 AM »

Np dude, already had the script, took me 30 sec.
DFAx
Guest


Email
« Reply #3 on: October 06, 2006, 06:58:23 PM »

no wonder i couldnt find Sub OnMapLoad(index)

its on EE, not TE X_X

any solutions to often saving?
Shadow Master
Leader of the Society Of Flaws
Member
**
Offline Offline

Posts: 52


View Profile Email
« Reply #4 on: October 06, 2006, 08:50:26 PM »

Ilnair u must be a devils worker. Lol
DFAx
Guest


Email
« Reply #5 on: October 07, 2006, 05:03:55 AM »

I just did save tiles......

hmmmmm

yeah i saw that equipment bug, happened to 2 of my players last nite

had to clear their equipment.....
i used the script you provided...hopefully it wont occur anymore

so u said that doesnt save their equipment?
Does that mean a possible loss of equipment?
Ilnair
The Uber-Scriptor
Advanced Member
****
Offline Offline

Posts: 592


The Uber-Scriptor


View Profile WWW Email
« Reply #6 on: October 08, 2006, 11:17:37 AM »

No. It means it doesn't save the fact that they are WEARING/WIELDING it. So all that happens is that when the server crashes, some players will have to re-equip some stuf...

Quote
and it does NOT affect game play in any way (exept for the fact that you might have to reequip something on first relog after server crash).
DFAx
Guest


Email
« Reply #7 on: October 08, 2006, 01:54:29 PM »

right, sorry, i realized that later because the item still does remain in your inventory

thx for that awesome script

i set a 2 minute timer to autosave =)

I learned how to script in 1 day hehe

but I did experience 2 minor problems with TE

These 2 methods do not work
GetPlayerMaxMP()
and
PlaySound()

maybe PlaySound() isnt in TE, but getPlayerMaxMP()
Ilnair
The Uber-Scriptor
Advanced Member
****
Offline Offline

Posts: 592


The Uber-Scriptor


View Profile WWW Email
« Reply #8 on: October 11, 2006, 07:35:07 AM »

Both are bugged, true.
DFAx
Guest


Email
« Reply #9 on: October 11, 2006, 08:54:46 AM »

actually, the playsound() started to work after awhile...not sure why though, I guess one of my scripts could of conflicted with it or something?

I'm sure that i had correct usage of it before...oh well, at least it works now
silverstein101
Newb
*
Offline Offline

Posts: 7


View Profile Email
« Reply #10 on: January 19, 2008, 08:24:49 PM »

ok, so i'm new at this, and kind of confused.  what does this do exactly? like, does it save the character so if they die right away, they can go log back in and they'll be where they were before?
‪‫‬‭‮‪‫‬‭The Admiral
-_-'
Moderator
Advanced Eclipser
*
Online Online

Posts: 1,186


!deifieD


View Profile WWW Email
« Reply #11 on: January 19, 2008, 09:53:54 PM »

No, see... without this script, if your server crashes, a player that could be playing the game and lvling for the past hour, would loose everything he did in that hour... this script prevents that
Bradybunch
Newb
*
Offline Offline

Posts: 12


View Profile Email
« Reply #12 on: January 23, 2008, 07:56:04 AM »

yeah i know i necro posted, but i still needed to know

lol thanks admiral :)
‪‫‬‭‮‪‫‬‭The Admiral
-_-'
Moderator
Advanced Eclipser
*
Online Online

Posts: 1,186


!deifieD


View Profile WWW Email
« Reply #13 on: January 23, 2008, 12:53:26 PM »

yeah i know i necro posted, but i still needed to know

lol thanks admiral :)

Do you = silverstein101?
*confused*
silverstein101
Newb
*
Offline Offline

Posts: 7


View Profile Email
« Reply #14 on: January 24, 2008, 11:17:27 AM »

lol my bad

i was on my friends computer
‪‫‬‭‮‪‫‬‭The Admiral
-_-'
Moderator
Advanced Eclipser
*
Online Online

Posts: 1,186


!deifieD


View Profile WWW Email
« Reply #15 on: January 24, 2008, 06:01:31 PM »

I see... Actually you didn't necropost, because the rules have been changed and necroposting is okay in this board(otherwise, you would of gotten a warning) now ^_^
silverstein101
Newb
*
Offline Offline

Posts: 7


View Profile Email
« Reply #16 on: January 25, 2008, 08:32:26 AM »

thats good, cause every new scripter is going to go looking through this entire section and have questions about it
Hoschi
Newb
*
Offline Offline

Posts: 1


View Profile Email
« Reply #17 on: November 08, 2008, 05:51:41 AM »

no wonder i couldnt find Sub OnMapLoad(index)

its on EE, not TE X_X

any solutions to often saving?

Paste this in the bottom of your Main.txt:
Code: [Select]
Sub OnMapLoad(Index)
Call Save(Index)
End Sub
Pages: [1]
  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 0.448 seconds with 33 queries.