Eclipse
January 05, 2009, 09:18:07 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 +-
Hmmm, I can't figure it out, lol by dragonlord52
Today at 09:18:06 PM

Sylerean Online Alpha 1.2 Released by The MrMiguu™ [pizza pretzles]
Today at 09:17:12 PM

fun with photoshop by kira423
Today at 09:17:11 PM

Dreadlord Online v1.2 Beta - Need Moderators and Trustworthy Mappers! by kira423
Today at 09:15:27 PM

Showoff :P by The MrMiguu™ [pizza pretzles]
Today at 09:13:04 PM

Lostica [Project Revamp] by The MrMiguu™ [pizza pretzles]
Today at 09:11:12 PM

My Game by HawkStorm95
Today at 09:10:14 PM

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

Members Online +-
13 Guests, 21 Users
dragonlord52,
Peter,
Munro,
kira423,
ralir,
The MrMiguu™ [pizza pretzles],
The Roujo,
~<Danny>~,
‪‫‬‭‮‪‫Kusy,
‪‫‬‭‮‪‫‬‭The Admiral,
Baron,
Kreator,
Leaf [zach],
HawkStorm95,
Amperglyph,
sleisysoft,
Ninja-Tech,
Kainan54,
Corza,
The Troy,
DarkMazer
Pages: [1] 2
  Print  
Author Topic: Auto-Updateing HighScore (fixed)  (Read 3232 times)
0 Members and 1 Guest are viewing this topic.
Simius Cruentus
Developer
Advanced Eclipser
*
Offline Offline

Posts: 1,659



View Profile Email
« on: September 24, 2006, 06:34:26 PM »

This script is dead, so I locked it.  If a mod wants it unlocked, feel free to unlock it.
~Admiral Refuge







background info:
This was orrigionally posted by M4k.
I changed it and reposted it under zack
now i fixed it more and am posting it under Homicidal Monkey
Difficulty: (|||||)> 2/5
Usefullness: (|||||)>4/5
here is the code:
Quote
Paste this at the bottom of your main.txt
Quote
'Auto-update Highscore
'Coded by zack a.k.a Homicidal Monkey
'version 1 based on /top5 by m4k
Sub HighScore(index)
Dim acc(50)
Dim Char(50)
Dim Charlvl(50)
i=1
j=1
C=0
Cnum = 0
Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "Level" , GetPlayerLevel(Index))
Do While C = 0
   acc(i) = GetVar("accounts.ini", "Players", "Name" & i)
   If acc(i) <> "" Then
      j = 1
      Do While j < 4
         If GetVar("accounts\" & acc(i) & ".ini", "CHAR" & j, "Name") <> "" Then
            Cnum=Cnum+1
            Char(Cnum) = GetVar("accounts\" & acc(i) & ".ini", "CHAR" & j, "Name")
            Charlvl(Cnum) = INT(GetVar("accounts\" & acc(i) & ".ini", "CHAR" & j, "Level"))
         End If
         j = j + 1
      Loop
      i = i + 1
   Else
      C=1
      Max=(i - 1)
   End If
Loop
Ca=1
Cb=2
Do While Ca < Cnum
   Do While Cb <= Cnum
      If Charlvl(Ca) < Charlvl(Cb) Then
         templvla = Charlvl(Ca)
         templvlb = Charlvl(Cb)
         tempnamea = Char(Ca)
         tempnameb = Char(Cb)
         Charlvl(Ca) = templvlb
         Charlvl(Cb) = templvla
         Char(Ca) = tempnameb
         Char(Cb) = tempnamea
      End If
      Cb=(Cb + 1)
   Loop
   Ca=(Ca + 1)
   Cb=(Ca + 1)
Loop
Call battleMsg(index, "Top 5 Players by Level", 15, 0)
Ca=1
Do While Ca <= 5
   Call battleMsg(index, Char(Ca) & " = Level " & Charlvl(Ca), 12, 0)
   Ca=Ca+1
Loop
Call GlobalMsg("Current Top Player: " & Char(1) & " at level " & charlvl(1), 15)
End Sub

Sub UpdateHS(Index)
Dim acc(50)
Dim Char(50)
Dim Charlvl(50)
z = 1
Do While C = 0
   If GetVar("accounts.ini", "Players", "Name" & z) <> "" then
      If GetVar("accounts.ini", "Players", "Name" & z) = GetPlayerLogin(index) Then
         C = 1
         'Call PlayerMsg(index, "Acc Exists!", 15)
      End if
      z = z + 1
   Else
      Call PutVar("accounts.ini", "Players", "Name" & z, GetPlayerLogin(index))
      'Call PlayerMsg(index, "Acc Added!", 6)
      C = 1
   End if
Loop
end sub   
ok we are almost done.
Put this Code at the top of joingame, leftgame, levelup
Quote
Call UpdateHS(Index)
          Call Highscore(Index)
After that you are done.
Remember:
Always back-up your main.txt
How to back-up:
1) Open Main.txt
2) Go to file, save as
3) Type "Main.backup" (with the " ")

how to open a back-up
1) open Main.backup with notepad
2) go to file, save as, main.txt
3) close main.backup. open main.txt
unnown
Teh Uberleet
*****
Offline Offline

Posts: 3,659


-Admin-


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

looks nice
Chrono917
Active Member
***
Offline Offline

Posts: 138



View Profile Email
« Reply #2 on: December 25, 2006, 04:03:53 PM »

How do you check the Hi-Scores?
Balliztik
Veteran
Advanced Eclipser
*
Offline Offline

Posts: 1,987


View Profile Email
« Reply #3 on: December 25, 2006, 11:48:51 PM »

You could set up a command to call HighScore(index),cor you can go to, looks like, accounts.ini.
Simius Cruentus
Developer
Advanced Eclipser
*
Offline Offline

Posts: 1,659



View Profile Email
« Reply #4 on: January 04, 2007, 05:06:44 PM »

How do you check the Hi-Scores?
when logging in, someone else logs in, or just make a command under "/help" that calls sub highscore
Soljah
The Mapper
Global Moderator
Teh Uberleet
*
Offline Offline

Posts: 3,242

Check my Mapping Tut's out!


View Profile WWW Email
« Reply #5 on: January 04, 2007, 05:25:54 PM »

How do you check the Hi-Scores?
when logging in, someone else logs in, or just make a command under "/help" that calls sub highscore

The code works nicely, but just how do u make a command under /help that calls sub highscore?? could you help me?
Simius Cruentus
Developer
Advanced Eclipser
*
Offline Offline

Posts: 1,659



View Profile Email
« Reply #6 on: January 04, 2007, 05:48:48 PM »

How do you check the Hi-Scores?
when logging in, someone else logs in, or just make a command under "/help" that calls sub highscore

The code works nicely, but just how do u make a command under /help that calls sub highscore?? could you help me?

Code: [Select]
Case "/Highscore"
call Highscore(Index)
Call UpdateHs(Index)
exit sub
Soljah
The Mapper
Global Moderator
Teh Uberleet
*
Offline Offline

Posts: 3,242

Check my Mapping Tut's out!


View Profile WWW Email
« Reply #7 on: January 04, 2007, 06:03:55 PM »

Tyvm
Soljah
The Mapper
Global Moderator
Teh Uberleet
*
Offline Offline

Posts: 3,242

Check my Mapping Tut's out!


View Profile WWW Email
« Reply #8 on: January 04, 2007, 06:11:18 PM »

hmm i no whatcha meen, but where bouts does it go... before? after? or gith in the middle of this


    If LCase(Trim(TextSay)) = "/help" Then
        Call PlayerMsg(index, "Social Commands:", 15)
        Call PlayerMsg(index, "'msghere = Broadcast Message", 15)
        Call PlayerMsg(index, "-msghere = Emote Message", 15)
        Call PlayerMsg(index, "!namehere msghere = Player Message", 15)
        Call PlayerMsg(index, "Available Commands: /help, /info, /who, /fps, /inv, /stats, /train, /party, /join, /leave, /refresh", 15)
    Exit Sub
    End If

zak
Newb
*
Offline Offline

Posts: 14


View Profile Email
« Reply #9 on: March 27, 2007, 07:37:40 AM »

help wit cmd pl0x
Uarepo2
Newb
*
Offline Offline

Posts: 7


View Profile Email
« Reply #10 on: March 27, 2007, 12:53:42 PM »

   Case "/top5"
        Call HighScore(Index)
        Exit Sub


Anywhere near the end of your commands sub (inbetween 2 subs obviously like this :

Case "/bell"
        Call GlobalMsg("*ding* *ding* *ding*", 7)
        Exit Sub

   Case "/top5"
        Call HighScore(Index)
        Exit Sub

    Case "/killall"
        If GetPlayerName(index) = "scott300" then
            Call SetPlayerHP(index, 0)
            Call SendPlayerData(index)
        End If
        Exit Sub
End Select


Sorry about the glow, Not sure how to put them in there own little boxes lol
olliepop
Member
**
Offline Offline

Posts: 70

Since Eclipse 3.7


View Profile Email
User is banned from postingMuted
« Reply #11 on: April 24, 2007, 03:23:02 PM »

['code']['/code']
But remove the '
KainBloodbane
Awesome Panda.
Active Member
***
Offline Offline

Posts: 261


Mapper Extrordinaire


View Profile WWW Email
« Reply #12 on: April 25, 2007, 03:33:20 PM »

Great Script! I have a question though. If I want to exclude 3 admins from the high scores named:

KainBloodbane
Alex Fernandez
Lightningsun

How can I do that? I want them to  be excluded so the other players can fairly get a high score without admins all taking the top spots.
Simius Cruentus
Developer
Advanced Eclipser
*
Offline Offline

Posts: 1,659



View Profile Email
« Reply #13 on: April 25, 2007, 03:59:50 PM »

Great Script! I have a question though. If I want to exclude 3 admins from the high scores named:

KainBloodbane
Alex Fernandez
Lightningsun

How can I do that? I want them to  be excluded so the other players can fairly get a high score without admins all taking the top spots.
I believe this would exclude admins:
Code: [Select]
Sub UpdateHS(Index)
Dim acc(50)
Dim Char(50)
Dim Charlvl(50)
z = 1
Do While C = 0
   If GetPlayerAccess(Index) < 2 then
   If GetVar("accounts.ini", "Players", "Name" & z) <> "" then
      If GetVar("accounts.ini", "Players", "Name" & z) = GetPlayerLogin(index) Then
         C = 1
         'Call PlayerMsg(index, "Acc Exists!", 15)
      End if
      z = z + 1
   Else
      Call PutVar("accounts.ini", "Players", "Name" & z, GetPlayerLogin(index))
      'Call PlayerMsg(index, "Acc Added!", 6)
      C = 1
   End if
End If
Loop
end sub   
۩ŞṗάỈᾗἷỗהּ۩
ćŎďēŔ, MąppĚř, AŕŦįsŢ
Developer
Advanced Eclipser
*
Offline Offline

Posts: 1,019

http://www.arklandonline.com


View Profile Email
« Reply #14 on: April 25, 2007, 04:13:23 PM »

Ohh, I think I better add that to the server now, Thanks.
Doesn't Work.
When I step on the scripted tile since I added the exclued admins it says this script is taking longer then expected to execute.
Balliztik
Veteran
Advanced Eclipser
*
Offline Offline

Posts: 1,987


View Profile Email
« Reply #15 on: April 25, 2007, 05:33:56 PM »

It's because there's a loop while C = 0. A simple exit sub or a C = 1 should fix it.

Quote
Sub UpdateHS(Index)
Dim acc(50)
Dim Char(50)
Dim Charlvl(50)
z = 1
Do While C = 0
   If GetPlayerAccess(Index) < 2 then
   If GetVar("accounts.ini", "Players", "Name" & z) <> "" then
      If GetVar("accounts.ini", "Players", "Name" & z) = GetPlayerLogin(index) Then
         C = 1
         'Call PlayerMsg(index, "Acc Exists!", 15)
      End if
      z = z + 1
   Else
      Call PutVar("accounts.ini", "Players", "Name" & z, GetPlayerLogin(index))
      'Call PlayerMsg(index, "Acc Added!", 6)
      C = 1
   End if
Else
Exit Sub

End If
Loop
end sub   
۩ŞṗάỈᾗἷỗהּ۩
ćŎďēŔ, MąppĚř, AŕŦįsŢ
Developer
Advanced Eclipser
*
Offline Offline

Posts: 1,019

http://www.arklandonline.com


View Profile Email
« Reply #16 on: April 25, 2007, 06:38:21 PM »

Thanks Balliztik, Unfortunatly it still doesn't work Its easier just to give staff items that boost stats rather then them havning levels anyways
Flaw
Member
**
Offline Offline

Posts: 89

GUI/GFX MAN!


View Profile Email
« Reply #17 on: April 30, 2007, 05:30:52 AM »

relating to this... Is there a way to post a top 50 players on a game website... and have the client auto up date that? at set time intervals?
unnown
Teh Uberleet
*****
Offline Offline

Posts: 3,659


-Admin-


View Profile Email
« Reply #18 on: April 30, 2007, 06:53:24 AM »

yeah it is possible but only if you can create an ftp upload program
Flaw
Member
**
Offline Offline

Posts: 89

GUI/GFX MAN!


View Profile Email
« Reply #19 on: May 29, 2007, 05:28:31 AM »

Sorry for necropost, but i just remembered that i posted here...

How to i make an FTP upload program?
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 0.358 seconds with 32 queries.