Redeem Bot

FarisDev

L oryh brx
Contributor
Jun 9, 2016
277
111
107
Hello All, I'm made a bot.
That's got requested By @xCHeF
Functions:
When you put a code (In config) Like XXXX-XXXX-XXXX-XXXX
When he type the code On the website got a rank.
If wrong code type wrong tries again.
Requirements: Teamspeak3 PHP Framework Search for it :D

Code (index.php)
PHP:
<?PHP

require_once("libraries/TeamSpeak3/TeamSpeak3.php");
include_once("config.php");
//This code for get his own information
$botname_info = '[R4P3]Info';
$ts3_VirtualServer = TeamSpeak3::factory("serverquery://".$YATQA_username.":".$YATQA_password."@".$server_ip.":".$YATQA_queryport."/?server_port=".$server_port."&nickname=".$botname_info."");
foreach($ts3_VirtualServer->clientList() as $ts3_client) {

if($_SERVER['REMOTE_ADDR'] == $ts3_client['connection_client_ip']) {
$nicknames[] = $ts3_client["client_nickname"];
$nickname = $ts3_client["client_nickname"];
$dbid = $ts3_client["client_database_id"];
$clid = $ts3_client["clid"];
$uid = $ts3_client["client_unique_identifier"];

}
}
if (isset($_POST['submit'])) {
    $redeem_1 = $_POST['redeemcode'];
if ($redeem_1 == $code) {
        //Type what do you want to say to him when he correctly type the code *In website*
        echo '<center><strong>correctly</strong></center>';
        //Here Type the commands your want, If he correctly type the code, As do you want I just make a command to give Him a group :D
        $ts3_VirtualServer = TeamSpeak3::factory("serverquery://".$YATQA_username.":".$YATQA_password."@".$server_ip.":".$YATQA_queryport."/?server_port=".$server_port."&nickname=".$botname."");
        $ts3_VirtualServer->clientGetByUid("$uid")->addServerGroup($sgid);
        die;
  }else{
      //Here type what do you want to say to him when he wrong :D
      echo '<center><strong>Wrong/try Again</strong></center>';
        header("Refresh:3; url=code.php");
  }
}



?>
<html>
<head>
<meta charset="UTF-8">
<title>Redeem-Page</title>
<link href="bootstrap.min.css" rel="stylesheet">
</head>
<body>
<form method="POST">
        <center>
<h1 style="
    font-size: 50px;
">Redeem Bot</h1>
            <label for="redeemcode">Code:</label>
            <input type="text" id="redeemcode" name="redeemcode">
     
            <div class="row push-15-t">
            </div><br><br>
            <input type="submit" value="Active The code" name = "submit">
        </form><br><br><br>
        <p>2017 &copy; Professional Developer's Team @Special </p>

</body>
</html>



</body>

Code (Config):

PHP:
<?php

#   ____             __ _    
#  / ___|___  _ __  / _(_) __ _
# | |   / _ \| '_ \| |_| |/ _` |
# | |__| (_) | | | |  _| | (_| |
#  \____\___/|_| |_|_| |_|\__, |
#                         |___/
// Info
$YATQA_username = '';
$YATQA_password = '';
$YATQA_queryport = '';
$server_ip = '';
$server_port = '';
$botname = 'Redeem%20Bot%20['. mt_rand(0, 99).']';
// Code Here:
$code = 'R4P3.net/test_code';
$sgid = '';





?>
 
Last edited:

Norvik

Retired Staff
Contributor
Jul 18, 2015
635
588
157
It would make more sense to implement a database that holds all possible keys. It should mark a key as used as soon as somebody used it since you could just share the key with your friends in the current script.
 

FarisDev

L oryh brx
Contributor
Jun 9, 2016
277
111
107
@Ridicc I know, I'm busy because I have exam's/ I do not have time to make or editing, If you want to make it and sharing to people You can.
Anyway thank you for your reply :D
 

FarisDev

L oryh brx
Contributor
Jun 9, 2016
277
111
107
@Cepkin I just do when he put the code Got a group, You must add a group id on config (sgid)
 

FarisDev

L oryh brx
Contributor
Jun 9, 2016
277
111
107
Edit header refresh @Cepkin index.php, I just put My file name is code because my file name is code.php, Just change it
 

Pain

Member
Feb 20, 2016
102
17
53
i dont't understand what does these bot, can someone pls explain it to me ? ty
 

FarisDev

L oryh brx
Contributor
Jun 9, 2016
277
111
107
@Pain That's mean redeembot First you put a code on config.php, When the users put the code (you put Him on config.php) Get group on teamspeak3, Like *VIP* etc.
 
Top