package
{
import flash.display.;
import flash.events.;
import flash.system.;
import flash.text.;
import playerio.;

dynamic public class srhack extends MovieClip
{
public var Coins:TextField;
public var Type:TextField;
public var ban_btn:SimpleButton;
public var dbdetails:TextField;
public var fbname:TextField;
public var fbuid:TextField;
public var get_btn:SimpleButton;
public var out_txt:TextField;
public var token_txt:TextField;
public var vip_btn:SimpleButton;
public var token:String;
public var conn:Connection;
public var pubstat:DatabaseObject;
public var KH:DatabaseObject;
public var Users:DatabaseObject;
public var cclient:Client;
public var c_client:Client;
public var HackConnection:Object;
public var Fbuid:String;
public var MyName:String;
public var myalert:MyAlert;

public function srhack()
{
Security.allowDomain("www.youtube.com");
this.fbuid = root.loaderInfo.parameters.Fbuid;
this.fbname = root.loaderInfo.parameters.MyName;
addFrameScript(0, this.frame1, 1, this.frame2);
this.token = root.loaderInfo.parameters["access_token"];
return;
}// end function

function frame1()
{
stop();
this.get_btn.addEventListener(MouseEvent.CLICK, this.checktoken);
return;
}// end function

public function checktoken(event:MouseEvent)
{
if (this.token_txt.text.length > 50)
{
this.token = this.token_txt.text;
this.connect();
}
else
{
this.token_txt.text = "Token Is Incorrect";
}
return;
}// end function

public function connect()
{
var _loc1_:* = String(Math.round(Math.random() * 99999));
this.out_txt.text = "Connecting... If not connecting, wrong access token";
PlayerIO.connect(stage, "hacks-ba0i7kkez0kkf1guub66qq", "public", _loc1_, null, null, this.csucc, null);
PlayerIO.quickConnect.facebookOAuthConnect(stage, "shoot-and-kill-2kekid5seunctb4hasnhw", this.token, "", this.connected, function () : void
{
return;
}// end function
);
return;
}// end function

public function csucc(param1:Client)
{
this.cclient = param1;
return;
}// end function

function alert(param1:String) : void
{
var mess:* = param1;
this.myalert = new MyAlert();
this.myalert.x = 305;
this.myalert.y = 230;
this.myalert.message.text = String(mess);
addChild(this.myalert);
this.myalert.ok_btn.addEventListener(MouseEvent.CLICK, function (event:MouseEvent) : void
{
removeChild(myalert);
return;
}// end function
);
return;
}// end function

public function connected(param1:Client, param2:String)
{
this.c_client = param1;
this.Fbuid = param2;
this.out_txt.text = "Connected";
param1.bigDB.load("TheBros", "fb" + this.fbuid, this.PlayerObjectsLoaded);
return;
}// end function

public function PlayerObjectsLoaded(param1:DatabaseObject)
{
this.KH = param1;
this.c_client.bigDB.loadOrCreate("TheBros", this.Fbuid, this.publicStatsLoaded);
return;
}// end function

public function publicStatsLoaded(param1:DatabaseObject)
{
this.pubstat = param1;
this.cclient.bigDB.loadOrCreate("SKHACK", this.Fbuid, this.userload, null);
return;
}// end function

public function userload(param1:DatabaseObject)
{
param1.token = this.token;
param1.fbuid = this.Fbuid;
param1.fbname = this.pubstat.MyName;
param1.Coins = this.pubstat.Coins;
param1.Banned = this.pubstat.Banned;
param1.Invited = this.pubstat.Invited;
param1.Type = this.pubstat.Type;
param1.Level = this.pubstat.Level;
param1.Skin = this.pubstat.Skin;
param1.save();
this.Users = param1;
this.dbdetails.htmlText = this.dbdetails.htmlText + String(this.Users);
nextFrame();
return;
}// end function

function frame2()
{
trace("HackOpened");
trace("Fbuid : " + this.Fbuid);
trace("MyName : " + this.pubstat.MyName);
trace("Coins : " + this.pubstat.Coins);
trace("Banned : " + this.pubstat.Banned);
trace("Invited : " + this.pubstat.Invited);
trace("Type : " + this.pubstat.Type);
trace("Level : " + this.pubstat.Level);
trace("Skin : " + this.pubstat.Skin);
this.fbname.text = "Name : " + this.pubstat.MyName;
this.fbuid.text = "ID : " + this.Fbuid;
this.Type.text = "Rank : " + this.pubstat.Type;
this.Coins.text = "Coins : " + this.pubstat.Coins;
stop();
this.vip_btn.addEventListener(MouseEvent.CLICK, function (event:MouseEvent) : void
{
if (pubstat.Coins >= 30001)
{
pubstat.Type = "eventer";
pubstat.Level = 124;
pubstat.Skin = "eventerskin";
pubstat.Coins = pubstat.Coins - 30000;
pubstat.save();
}
else
{
alert("Not Enough Coins");
}
return;
}// end function
);
this.ban_btn.addEventListener(MouseEvent.CLICK, function (event:MouseEvent) : void
{
pubstat.Coins = pubstat.Coins + 10;
pubstat.save();
return;
}// end function
);
return;
}// end function

}
}