Page 2 of 2 FirstFirst 12
Results 26 to 30 of 30

Thread: How to make live stats images for your scripts

  1. #26
    Join Date
    Feb 2012
    Location
    DON'T PM ME ASKING FOR STUFF
    Posts
    2,170
    Mentioned
    38 Post(s)
    Quoted
    423 Post(s)

    Default

    Quote Originally Posted by Kyle Undefined View Post
    You cannot "split" the text from the image. That's why you're printing out the text on top of the image, to make it a PHP image. It's either you cache everything, or you don't cache at all. Because even if the text changes, you'll have to create a whole new image, which defeats the purpose of caching.

    I'd do an hour cache, that's the normal for these type of things.
    Thanks for confirming Kyle.

  2. #27
    Join Date
    Feb 2012
    Location
    Canada
    Posts
    1,164
    Mentioned
    26 Post(s)
    Quoted
    433 Post(s)

  3. #28
    Join Date
    Feb 2012
    Location
    Discord
    Posts
    3,114
    Mentioned
    37 Post(s)
    Quoted
    538 Post(s)

    Default

    Right so I've been trying to follow this guide, but wanting to make something slightly different.

    Firstly the simba code:
    Simba Code:
    program new;


    function AddAccount(login, password: String; TutIsland:Boolean; MageLevel:Integer):Boolean;
    var
      i : Integer;
      a: String;
    begin

      i := InitializeHTTPClient(False);  //this creates a client
      //login, pw, TutIsland, MageLevel
      AddPostVariable(i, 'login', login);//This adds our info to the client
      AddPostVariable(i, 'pw', password);
      AddPostVariable(i, 'TutIsland', ToStr(TutIsland));//This adds our info to the client
      AddPostVariable(i, 'MageLevel', IntToStr(MageLevel));
      a := Lowercase(PostHTTPPageEx(i, 'http://tkfarm.esy.es/AddAccount.php'));
      Result := Pos('true', a) <> 0;//Then this posts it
      Writeln(a);
      FreeHTTPClient(i);//Remember to free it


    end;

    begin
      Writeln(AddAccount('srl@gmail.com', 'gg', false, 1));
    end.

    The output from this is
    Code:
    <!doctype html public "-//ietf//dtd html 2.0//en">
    <html><head>
    <title>302 found</title>
    </head><body>
    <h1>found</h1>
    <p>the document has moved <a href="http://error.hostinger.eu/403.php?">here</a>.</p>
    </body></html>
    
    False

    So its clearly not working correctly, though I have no idea why...

    here's the php code:
    PHP Code:
    <?PHP 

        $user_name 
    "u791978145_tk";  //Username for the account you created earlier 
        
    $pass_word "removed";  //Password for the account you created earlier 
        
    $database "u791978145_tk";  //The name of the database you created earlier 
        
    $server "mysql.hostinger.co.uk";  //With 000webhost this can be found by going to your control panel then clicking MySQL  

        
    $login $_POST['login'];//The things in the [] can be anything you want, but remember these for later 
        
    $pw $_POST['pw'];  
        
    $tutisland $_POST['TutIsland'];
        
    $magelevel$_POST['MageLevel'];
        
            
       
        
    // Create connection
        
    $conn = new mysqli($server$user_name$pass_word);

        
    // Check connection
        
    if ($conn->connect_error) {
           die(
    "Connection failed: " $conn->connect_error);
        }
        
    $sql "INSERT INTO Accounts (Login, Pw, TutIsland, MageLevel) VALUES ('"$login "' ,'" $pw "', '" $tutisland "', '" $magelevel "');";//Or whatever you called your table and script 
        
    $result $conn->query($sql);
        print 
    $login $pw $tutisland $magelevel;
        print 
    $sql;
        print 
    $result;
        if(
    $result
            print 
    "True"
        else 
            print 
    "False";       
           
    ?>

  4. #29
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Quote Originally Posted by Olly View Post
    Set a user agent:

    Simba Code:
    SetHTTPUserAgent(i, 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.85 Safari/537.36');
    You probs also want to close the connection > mysqli_close($conn);

  5. #30
    Join Date
    Feb 2012
    Location
    Discord
    Posts
    3,114
    Mentioned
    37 Post(s)
    Quoted
    538 Post(s)

    Default

    Quote Originally Posted by Olly View Post
    You probs also want to close the connection > mysqli_close($conn);
    I guess thats an accidental double quote, but thanks a lot Olly, I'll try and make a list of the changes that are needed to this thread and get an admin to update it

    edit: I was making some other scrub mistakes, but I figure that stuff out, not setting the user agent was my main problem

Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •