How do I create a Random IP generater for Hacking Game

  • When someone register's to my Game using register, I want them to have a Random fake IP

    When they register

    They will go to the homepage and it will say

    Welcome,User | IP: 0.19.192.12 <--- random

    It's a bitcoin hacking game

    Sorry if I dident explain properly

  • You can generate 4 random numbers and store them in variables then combine them and store them in a string.

    Random_IP = <Random nr 1> & "." & <Random nr 2> & "." & <Random nr 3> & "."& <Random nr 4>

    You can then use tokenat(Text, index, Seperator) if you ever have to extract the numbers again.

    Tokenat (Random_IP, 0, ".") <---- Will get you <Random nr 1> in above. So you simply increase the index number to get the rest of the numbers.

  • If it doesn't have to be unique or saved, you could just do something like:

    Set Text "Welcome, User | IP: " & floor(random(256)) & "." & floor(random(256)) & "." & floor(random(256)) & "." & floor(random(256))

  • Thanks guys really appreciate your help! <3

  • why do you want to use a fake ip if you can use the real one?

    is simple very simple in php:

    echo $_SERVER['REMOTE_ADDR'];[/code:1mqiodbj]
    
    or
    
    [code:1mqiodbj]function getUserIP()
    {
        $client  = $_SERVER['HTTP_CLIENT_IP'];
        $forward = $_SERVER['HTTP_X_FORWARDED_FOR'];
        $remote  = $_SERVER['REMOTE_ADDR'];
    
        if(filter_var($client, FILTER_VALIDATE_IP))
        {
            $ip = $client;
        }
        elseif(filter_var($forward, FILTER_VALIDATE_IP))
        {
            $ip = $forward;
        }
        else
        {
            $ip = $remote;
        }
    
        return $ip;
    }
    
    $user_ip = getUserIP();
    
    echo $user_ip;[/code:1mqiodbj]
    
    you have just to use ajax
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • #Ribis thanks for the Help tho but

    I don't want players real IP to be found by others

    This is a Bitcoin hacking game where each players will have a Virtual fake IP associated with their account, so they can hack each others IP address and steal Bitcoins from others and be the richest upgrading their security by spending the stolen bitcoins and make it harder for other to hack their IP

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)