Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (1 invisible), 509 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 4 of 4 1 2 3 4
Re: Online Jewel Drop + Highscore + GSTNet [Re: MrGuest] #310272
02/14/10 02:10
02/14/10 02:10
Joined: Oct 2005
Posts: 196
ambe Offline
Member
ambe  Offline
Member

Joined: Oct 2005
Posts: 196
addictive -.-'


- code monkey
Re: Online Jewel Drop + Highscore + GSTNet [Re: ambe] #310273
02/14/10 02:13
02/14/10 02:13
Joined: Feb 2009
Posts: 2,154
Damocles_ Offline OP
Expert
Damocles_  Offline OP
Expert

Joined: Feb 2009
Posts: 2,154
yes, ambe I can see you played quite a number of games wink

maybe I should Refresh the highscore, so there is some challenge
to get into that list


----

Ok, fresh highscore list.
And for the old Score Holders:


Here The All-Time best players list:

Chris!!!!! 21550
Chris 20310
Chris 19410
EnterYourName 18980
plsbeatmes 18290
Niceflits!e 17840
flits 17630
MichaelS 17370
test_1 16300
test_1 16160

Last edited by Damocles_; 02/14/10 02:20.
Re: Online Jewel Drop + Highscore + GSTNet [Re: MrGuest] #310286
02/14/10 09:55
02/14/10 09:55
Joined: Jan 2010
Posts: 112
Robso661 Offline
Member
Robso661  Offline
Member

Joined: Jan 2010
Posts: 112
das mit dem pointer wusste ich nur über handels wusste ich nicht so bescheid


Ja, das Programmieren ist schwer und zerreißt einem manchmal den Kopf. Aber dran bleiben ist alles dann kommt man auch weiter.

http://www.youtube.com/user/ErweSpiele
Re: Online Jewel Drop + Highscore + GSTNet [Re: Robso661] #310397
02/14/10 17:11
02/14/10 17:11
Joined: Feb 2009
Posts: 2,154
Damocles_ Offline OP
Expert
Damocles_  Offline OP
Expert

Joined: Feb 2009
Posts: 2,154
Seems to be a bit more action now in the Highscore.

Try to beat Ambe wink

Re: Online Jewel Drop + Highscore + GSTNet [Re: Damocles_] #310407
02/14/10 18:24
02/14/10 18:24
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
18870! WoohoO! grin

Though still nowhere near Chris previous top score frown


Re: Online Jewel Drop + Highscore + GSTNet [Re: MrGuest] #310408
02/14/10 18:25
02/14/10 18:25
Joined: Feb 2009
Posts: 2,154
Damocles_ Offline OP
Expert
Damocles_  Offline OP
Expert

Joined: Feb 2009
Posts: 2,154
Very good. I dont get over 9000

Re: Online Jewel Drop + Highscore + GSTNet [Re: Damocles_] #310529
02/15/10 09:39
02/15/10 09:39
Joined: Feb 2009
Posts: 2,154
Damocles_ Offline OP
Expert
Damocles_  Offline OP
Expert

Joined: Feb 2009
Posts: 2,154
Here the php codes used for this, if anyone wants to
use such a system for php based actions.

(Highscores, or even stuff like sendign messages or players
using the game currently)




Code:
<?php
//Higschore script


//parameterline: http://damocles11.byethost9.com/index2.php?name=hubert&score=12346


$name = $_GET['name'];
$score = $_GET['score']+0;  //+0 makes shure it will be an number
$check = $_GET['check']+0;  //checknumber


if(strcmp($name,"")==0) {$name="Player";}
if(strlen($name)>16) {$name="Player";}  //shorten too long names


$name=trim($name);  //remove spaces
$name=strip_tags($name); //remove tags
$name=str_replace("~","-",$name); //remove tilde

//check if score is valid
//this should be implemented with a new algorythm by the programmer

//echo "score:" . $score . "  check:" . $score%77 . "<br>";

if($check != $score%77) {$score=0;die("error!");}  //throw out wrong scores! 


/*
echo "Player: ";
echo $name;
echo "<br>has a score of: ";
echo $score;
echo "<br>----------------<br>";
*/


$filename="scores.txt";
$maxentries=10;  //maximum number of highscore entries

//check if Highscore file exists

if(file_exists($filename)==0)
{
    //create new Highscore

    //add new entry
    $handle = fopen ($filename, 'w+');
    rewind($handle);


    for($i=0;$i<$maxentries;$i++)
    {
      fputs($handle,"Player");
      fputs($handle,'~');
      fputs($handle,$maxentries+1-$i); //generate dummyscores
      fputs($handle,'~');
      
    }

    fclose($handle); //close file

}


//read contents
//compare if new Highscore is higher than one of the previous 10

    $handle = fopen ($filename, 'r');
    rewind($handle);

    $content=fgets($handle,filesize($filename));  //read the entries

    $elemente=explode('~',$content);

    $j=0;

    //retrive entries
    for($i=0; $i<$maxentries*2;$i+=2)  //read max 10 entries
    {
      
      $playerName[$j]=$elemente[$i];
      $playerScore[$j]=$elemente[$i+1];

    $j++;

    }

    //echo $content;

    fclose($handle); //close file




//check if player is part of the highscore

$newEntry=0;

for($i=0; $i<$maxentries;$i++)  //read max 10 entries
    {
 
      if($score>$playerScore[$i])
      {
       //push down lower entries
      
       for($j=$maxentries-1; $j>=$i;$j--)  //read max 10 entries
          {
            $playerName[$j+1]=$playerName[$j];
            $playerScore[$j+1]=$playerScore[$j];
           }
      
      // save entry
      $playerName[$i]=$name;
      $playerScore[$i]=$score;
      
      $newEntry=1;
      
      //$i=100; //just for savety
      break; //jump out of loop
      }
      
    }


//if($newEntry==1) {echo "better entry! <br>";}


//save the changed file

if($newEntry==1)
{

//overwrite old file
    $handle = fopen ($filename, 'w+');
    rewind($handle);


    for($i=0;$i<$maxentries;$i++)
    {
      fputs($handle,$playerName[$i]);
      fputs($handle,'~');
      fputs($handle,$playerScore[$i]);
      fputs($handle,'~');
    }

    //echo "$filename does not exist";
    fclose($handle); //close file

}


//now show all entries


    $handle2 = fopen ($filename, 'r');
    rewind($handle2);
/*
    $content2=fgets($handle2,filesize($filename)+1);  //read the entries

    $elemente2=explode('~',$content2);

    //retrive entries
    for($i=0; $i<$maxentries*2;$i+=2)  //read max 10 entries
    {
      echo $elemente2[$i] . "~" . $elemente2[$i+1] ."~";
   }

*/
  echo fread($handle2,filesize($filename)); 
    //echo $content;

    fclose($handle2); //close file
    

?>



Code:
<?php
//Higschore script
//alternate script, showing the recent players


//parameterline: http://damocles11.byethost9.com/index2.php?name=hubert&score=12346


$name = $_GET['name'];
$score = $_GET['score']+0;  //+0 makes shure it will be an number
$check = $_GET['check']+0;  //checknumber


if(strcmp($name,"")==0) {$name="Player";}
if(strlen($name)>16) {$name="Player";}  //shorten too long names


$name=trim($name);  //remove spaces
$name=strip_tags($name); //remove tags
$name=str_replace("~","-",$name); //remove tilde

//check if score is valid
//this should be implemented with a new algorythm by the programmer
//And of course not lie in an open sktipt...

//echo "score:" . $score . "  check:" . $score%77 . "<br>";

if($check != $score%77) {$score=0;die("error!");}  //throw out wrong scores! 


/*
echo "Player: ";
echo $name;
echo "<br>has a score of: ";
echo $score;
echo "<br>----------------<br>";
*/


$filename="recent.txt";
$maxentries=10;  //maximum number of highscore entries

//check if Highscore file exists

if(file_exists($filename)==0)
{
    //create new Highscore

    //add new entry
    $handle = fopen ($filename, 'w+');
    rewind($handle);


    for($i=0;$i<$maxentries;$i++)
    {
      fputs($handle,"Player");
      fputs($handle,'~');
      fputs($handle,0); //generate dummyscores
      fputs($handle,'~');
      
    }

    fclose($handle); //close file

}


//read contents
//compare if new Highscore is higher than one of the previous 10

    $handle = fopen ($filename, 'r');
    rewind($handle);

    $content=fgets($handle,filesize($filename));  //read the entries

    $elemente=explode('~',$content);

    $j=0;

    //retrive entries
    for($i=0; $i<$maxentries*2;$i+=2)  //read max 10 entries
    {
      
      $playerName[$j]=$elemente[$i];
      $playerScore[$j]=$elemente[$i+1];

    $j++;

    }

    //echo $content;

    fclose($handle); //close file





//save the changed file

if($score>0)
{




//overwrite old file
    $handle = fopen ($filename, 'w+');
    rewind($handle);

//add new player on top
      fputs($handle,$name);
      fputs($handle,'~');
      fputs($handle,$score);
      fputs($handle,'~');


//insert previous games (one less)

    for($i=0;$i<$maxentries-1;$i++)
    {
      fputs($handle,$playerName[$i]);
      fputs($handle,'~');
      fputs($handle,$playerScore[$i]);
      fputs($handle,'~');
    }

    //echo "$filename does not exist";
    fclose($handle); //close file

}


//now show all entries


    $handle2 = fopen ($filename, 'r');
    rewind($handle2);
/*
    $content2=fgets($handle2,filesize($filename)+1);  //read the entries

    $elemente2=explode('~',$content2);

    //retrive entries
    for($i=0; $i<$maxentries*2;$i+=2)  //read max 10 entries
    {
      echo $elemente2[$i] . "~" . $elemente2[$i+1] ."~";
   }

*/
  echo fread($handle2,filesize($filename)); 
    //echo $content;

    fclose($handle2); //close file
    

?>



Re: Online Jewel Drop + Highscore + GSTNet [Re: Damocles_] #310541
02/15/10 12:04
02/15/10 12:04
Joined: Oct 2005
Posts: 196
ambe Offline
Member
ambe  Offline
Member

Joined: Oct 2005
Posts: 196
BACK ON TOP! tongue


- code monkey
Re: Online Jewel Drop + Highscore + GSTNet [Re: ambe] #340691
09/06/10 18:31
09/06/10 18:31
Joined: Feb 2009
Posts: 2,154
Damocles_ Offline OP
Expert
Damocles_  Offline OP
Expert

Joined: Feb 2009
Posts: 2,154
I've reset the best players list, but keeping the best 4 players in.

There are still people playing it frequently.

Page 4 of 4 1 2 3 4

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1