Eclipse
January 05, 2009, 06:48:05 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 +-
Spike's Adminishness! by The BanHammer! [Thor!]
Today at 06:48:04 PM

Lostica [Project Revamp] by The Tribal
Today at 06:47:36 PM

Disparity Recruiting by Peter
Today at 06:40:01 PM

Azkanan's Workshop (Graphics) by Devogen
Today at 06:39:57 PM

Anywhere to download the v3 beta? by The Tribal
Today at 06:38:28 PM

Does anybody know the math involved in dmg to def? by Syner
Today at 06:30:40 PM

My New Computer! by The BanHammer! [Thor!]
Today at 06:25:05 PM

[E++] Fun with sprites! by Simius Cruentus
Today at 06:23:18 PM

how will the person above die. by The Tribal
Today at 06:20:30 PM

Need forum logos by ʇıunpp ʎqɹıʞ࣭
Today at 06:19:31 PM

Members Online +-
16 Guests, 26 Users
The BanHammer! [Thor!],
Niko,
Kreator,
Peter,
Gwendalin,
The Tribal,
Warconn,
Keebler Elf,
SoiWilliamSoi,
>~(Squiddle)~<,
kdjrgej,
Devogen,
Seba,
Syner,
Dimx,
FS:CG Admin[Shadowwulf],
Echo ♥ Pie,
l0lz!,
tiggilyboo,
Jax The Mighty,
Thelettersix,
Spike,
Sk3wer,
THE Tim,
calamity,
Greendude120
Pages: [1]
  Print  
Author Topic: Combined Exp  (Read 1339 times)
0 Members and 1 Guest are viewing this topic.
Topher
Active Member
***
Offline Offline

Posts: 203



View Profile Email
« on: September 02, 2006, 06:12:42 PM »



Ok, well here is a semi-usefull-ish thing that adds up all of the experience up to the level specified by you in an /exp # command. To install it, paste this to the bottom of your main.txt

Code: [Select]
Function ExpCount(index, level)
Dim exp
Dim i
Dim counter

exp = 0
counter = 1

Do While Int(counter) <= Int(level)
i = Int(GetVar("experience.ini",  "EXPERIENCE", "Exp" & counter))
exp = Int(Int(exp) + Int(i))
Counter = counter + 1
Loop

ExpCount = Int(exp)
End Function

Then, add this under the /warpto command in your Sub Commands

Code: [Select]
If LCase(Mid(TextSay, 1, 4)) = "/exp" Then
If Len(TextSay) > 4 Then
TextSay = Mid(TextSay, 5, Len(TextSay) - 4)
x = ExpCount(index, TextSay)
Call PlayerMsg(index, "The Combined Exp to Level " & TextSay & " is " & x, 14)
End If
Exit Sub
End If

Ok, well to use this ingame, simply type /exp and a space and the level you want exp added to. For example, /exp 10 to get all the exp added up to level 10 (it will include level 10.)

To call this function while scripting, use ExpCount(index, level) replacing level with the level you want caluclated to, again, it will include that level.

Hope you enjoy!
Topher

Balliztik
Veteran
Advanced Eclipser
*
Offline Offline

Posts: 1,987


View Profile Email
« Reply #1 on: September 02, 2006, 06:24:32 PM »

Nice, but it would help to have a command to see how much total exp you have as well.


Code: [Select]
Case "/currentexp"
Level = GetPlayerLevel(index) - 1
CurrentExp = GetPlayerExp(index)

Do While Level >= 1
CurrentExp = CurrentExp + Int(GetVar("experience.ini",  "EXPERIENCE", "Exp" & level))
Level = Level -1
Loop

Call PlayerMsg(index, "Your total exp is " & CurrentExp, 14)
Exit Sub
Topher
Active Member
***
Offline Offline

Posts: 203



View Profile Email
« Reply #2 on: September 02, 2006, 06:26:51 PM »

True....thanks  :)
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.284 seconds with 32 queries.