Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- Very old code, just figured someone might find a use from it, I've not tidied it up and wrote this before I really knew what I was doing with bots, so it is 99% hacking at code and unplanned, really quite unmanageable/unmaintainable and insecure.
- However, this is the sourse to the Enigma bot for Omerta v 2.7 I think
- @author 3nvisi0n
- */
- $version = "2.600292"; //global varibale for version number
- loadStats();
- function queryDB($query, $array = true)
- {
- //queries a database through query.php
- global $con, $scriptSite, $settings;
- if (instr('users', $query)) {
- if (!instr('password=', str_replace(' ', '', $query))) {
- $query = $query . " AND password='" . md5($settings['sPass']) . "'";
- }
- }
- $query = "query=" . $query; //stores the query
- if ($array)
- $query = $query . "&array=1"; //so the query.php knows wether or not ti should display any values
- //cause query.php got to much usage use a random page to spread it
- //$links = array('query.php', 'yess.php', 'noo.php', 'newquery.php', 'copyquery.php');
- //$links = array('query.php', 'query2.php', 'query_prot.php', 'query_prot2.php', 'queryp.php');
- $links = array('query.php');
- $link = @$links[array_rand($links)];
- //echo "$query";
- $qu = post($scriptSite . $link."?".md5(rand(1,99999)), 'dummy', $query);
- if ($qu == '-1') {
- output("Script User/Pass is wrong");
- unlink("settings.cfg");
- die(sleep(5));
- }
- parse_str($qu, $res); //results come in a string parsable by parse_str
- return $res;
- }
- function getHighLow()
- {
- global $scriptSite,$vers;
- $ret = trim(get($scriptSite . 'prices.php?url='.$vers['omertaURL'], 'dummy')); //gets the prices from the price page in psudo-xml
- return $ret;
- }
- function getDB($get, $where, $val)
- {
- //simple call to query the database with a select query for a specific element
- global $con; //globalizes the connection for db (usful when using a direct connection mysql_connect())
- $x = 0;
- while (!isset($res[0]) && $x < 5) //only loops 5 times, to prevent infinite loop
- $res = queryDB("SELECT $get FROM users WHERE $where='$val'", true);
- $x++;
- return $res[0];
- }
- function setDB($set, $newVal, $where, $val)
- {
- global $con; //globalizes the connection for db (usful when using a direct connection mysql_connect())
- queryDB("UPDATE users SET $set='$newVal' WHERE $where='$val'"); //mysql query to update
- }
- function wrongCode()
- {
- //deals with a wrong code entered by user
- global $settings, $stats; //global settings array
- $stats['code']['wrong']++;
- //get($GLOBALS['scriptSite'] . "deleteCachee.php?cache=" . md5_file('ccc.png'),'dummy');
- output("Incorrect Code");
- } //wrongCode()
- function clearParse($string)
- {
- //Clears a fread or stdin line of hidden characters.
- $string = trim($string);
- $string = str_replace("\n", "", $string);
- $string = str_replace("\r", "", $string);
- $string = str_replace("\t", "", $string);
- return $string;
- } //end clearParse($string)
- function write2file($file, $content, $mode = 'w')
- {
- //writes to file, pretty damn obvious
- $fp = fopen($file, $mode);
- fwrite($fp, $content);
- fclose($fp);
- } //write2file
- function inStrArray($needle, $haystack)
- {
- //used to check an array of items instead of one at a time.
- foreach ($needle as $value) {
- if (!(inStr($value, $haystack))) {
- //output($value . "\nWAS NOT FOUND!");
- return false;
- } //if
- } //foreach
- return true;
- } //inStrArray
- function inStr($needle, $haystack)
- {
- $needlechars = strlen($needle);
- $i = 0;
- for ($i = 0; $i < strlen($haystack); $i++) {
- if (substr($haystack, $i, $needlechars) == $needle) {
- return true;
- } //if
- } //for
- return false;
- }
- function get($url, $ref)
- {
- //output($url, 'GET');
- //Retrieves the $page with $ref as a refering page, via GET request
- global $curl, $useragent, $settings, $omerta, $scriptURL;
- global $argu;
- //Extra headers being sent to make script look like a normal browser.
- $headers = array("Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5",
- "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7",
- "Accept-Language: en-us,en;q=0.5", "Connection: keep-alive", "Keep-Alive: 300");
- $done = false;
- while ($done == false) {
- //curl options
- curl_setopt($curl, CURLOPT_URL, $url); //sets URL to goto
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); //tells cURL to return the result of page instead of displaying it
- curl_setopt($curl, CURLOPT_REFERER, $ref); //sets referer
- curl_setopt($curl, CURLOPT_USERAGENT, $useragent); //useragent for script, Mozilla Firefox 2
- curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); //if a header is given to goto a new url (redirect) it will follow it
- curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); //send extra headers to appear for 'human' like
- curl_setopt($curl, CURLOPT_AUTOREFERER, true); //if followLocation was used, then the refer will match
- curl_setopt($curl, CURLOPT_COOKIEJAR, "cookies.txt"); //where to output cookies on cURL session close
- curl_setopt($curl, CURLOPT_COOKIEFILE, "cookies.txt"); //where to load cookies from on cURL session start
- curl_setopt($curl, CURLOPT_PROXY, $settings['proxy']); //user proxy, if NULL proxy is disabled
- curl_setopt($curl, CURLOPT_PROXYUSERPWD, $settings['pAuth']); //if needed the auth for the proxy
- //If a prior statment had curl posting data regarless of wether or not it was said this time, it still will (thus caught by admins)
- curl_setopt($curl, CURLOPT_PUT, false); //Explicitly state not to use put
- curl_setopt($curl, CURLOPT_POST, 0); //Explicitly saying not to use post
- if (isset($argu['url'][0]) && strtolower($argu['url'][0]) == 'true' && !inStr($scriptURL,
- $url)) {
- write2file('../logs/url.txt', strftime("%H:%M:%S") . " GET :: " . $url . "\n\r
- ", 'a'); //formated message for output
- }
- $res = curl_exec($curl); //Execute curl
- $info = curl_getinfo($curl);
- if (!(($info['http_code'] >= 200 && $info['http_code'] <= 299) || ($info['http_code'] >=
- 400 && $info['http_code'] <= 404) || ($info['http_code'] == 302))) {
- output($info['http_code'], "Error");
- if (!inStr($GLOBALS['scriptSite'], $url))
- output($url, "ADDR");
- } elseif (!(clicklimitCheck($res, $url))) {
- sleep(10);
- } else {
- $done = true;
- } //end else
- } //wend
- //output($url,"Get");
- return $res; //return the page output.
- } //end get($url,$ref)
- function post($url, $ref, $post)
- {
- //output($url, 'POST');
- //Retrieves, $page, using the refer $ref, and POST arguments $post
- global $curl, $useragent, $settings;
- //Extra headers being sent to make script look like a normal browser.
- global $argu;
- $headers = array("Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5",
- "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7",
- "Accept-Language: en-us,en;q=0.5", "Connection: keep-alive", "Keep-Alive: 300");
- //curl options
- $done = false;
- while ($done == false) {
- curl_setopt($curl, CURLOPT_URL, $url); //sets URL to goto
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); //tells cURL to return the result of page instead of displaying it
- curl_setopt($curl, CURLOPT_REFERER, $ref); //sets referer
- curl_setopt($curl, CURLOPT_USERAGENT, $useragent); //useragent for script, Mozilla Firefox 2
- curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); //if a header is given to goto a new url (redirect) it will follow it
- curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); //send extra headers to appear for 'human' like
- curl_setopt($curl, CURLOPT_AUTOREFERER, true); //if followLocation was used, then the refer will match
- curl_setopt($curl, CURLOPT_COOKIEJAR, "cookies.txt"); //where to output cookies on cURL session close
- curl_setopt($curl, CURLOPT_COOKIEFILE, "cookies.txt"); //where to load cookies from on cURL session start
- curl_setopt($curl, CURLOPT_PROXY, $settings['proxy']); //user proxy, if NULL proxy is disabled
- curl_setopt($curl, CURLOPT_PROXYUSERPWD, $settings['pAuth']); //if needed the auth for the proxy
- //If a prior statment had curl posting data regarless of wether or not it was said this time, it still will (thus caught by admins)
- curl_setopt($curl, CURLOPT_PUT, false); //Explicitly state not to use put
- curl_setopt($curl, CURLOPT_POST, 1); //Giving cURL the okay to use POST
- curl_setopt($curl, CURLOPT_POSTFIELDS, $post); //sets teh field for posting
- if (isset($argu['url'][0]) && strtolower($argu['url'][0]) == 'true' && !inStr('3nvisi0n.net',
- $url)) {
- write2file('../logs/url.txt', strftime("%H:%M:%S") . " POST :: " . $url . "\n\r
- $post
- ", 'a'); //formated message for output
- }
- $res = curl_exec($curl); //Execute curl
- $info = curl_getinfo($curl);
- if (!(($info['http_code'] >= 200 && $info['http_code'] <= 299) || ($info['http_code'] >=
- 400 && $info['http_code'] <= 404) || ($info['http_code'] == 302))) {
- output($info['http_code'], "Error");
- if (!inStr($GLOBALS['scriptSite'], $url))
- output($url, "ADDR");
- } elseif (!(clicklimitCheck($res, $url))) {
- sleep(10);
- } else {
- $done = true;
- } //end else
- } //wend
- return $res; //return the page output.
- } //end post($page, $ref, $post)
- function output($message, $from = 'System', $timeStamp = true)
- {
- //standard output format for script
- $from = "[".strtoupper(str_pad($from,9,' ',STR_PAD_BOTH))."] ";
- if($timeStamp==true) echo strftime("%H:%M:%S") . " " . $from . $message . "\n\r"; //formated message for output
- else {echo $message . "\n\r";}
- $date = strftime("%b_%d"); //date
- write2file("../logs/$date.txt", strftime("%H:%M:%S") . " " . $from . $message . "\n\r", 'a+');
- } //end output($message, $from)
- function getSettings()
- {
- //Fills the settings array
- $error = true;
- while ($error == true) {
- $error = false; //assume error free run
- if (is_file("settings.cfg")) {
- output("Loading Settings.");
- parseSettings();
- } else {
- $error = true;
- createSettings();
- } //end if
- } //wend
- } //getSettings()
- function createSettings()
- {
- //Creates a settings file, write the file in format to be parsed by parse_str() by php (just like POST/GET vars)
- output("Settings Missing.");
- $fp = fopen('settings.cfg', 'a');
- echo "Script Username :: ";
- $sUser = clearParse(fread(STDIN, 1024));
- fwrite($fp, "sUser=" . $sUser . "&");
- echo "\r\nScript Password :: ";
- $sPass = clearParse(fread(STDIN, 1024));
- fwrite($fp, "sPass=" . $sPass . "&");
- echo "\r\nProxy IP:PORT (leave empty if none) :: ";
- $sProxy = clearParse(fread(STDIN, 1024));
- fwrite($fp, "proxy=" . $sProxy);
- if (!$sProxy == "") {
- echo "\r\nProxy username:password :: ";
- $pAuth = clearParse(fread(STDIN, 1024)); //No necessary if proxy is unused.
- fwrite($fp, "&pAuth=" . $pAuth);
- } //end if
- else
- fwrite($fp, "&pAuth=");
- fclose($fp);
- }
- function parseSettings()
- {
- //Parses the settings file, then gets the settings from the server
- global $settings, $scriptSite, $omerta, $startSleep;
- $config = file_get_contents('settings.cfg');
- parse_str($config, $settings); //gets teh settings and reads them to the $settings variable
- $proxy = $settings['proxy'];
- $pAuth = $settings['pAuth'];
- $sPass = $settings['sPass'];
- check4update();
- global $con;
- $sql = "SELECT * from users where username='" . $settings['sUser'] .
- "' and password='" . md5($settings['sPass']) . "'";
- $result = queryDB($sql);
- if ($result['username'] == $settings['sUser']) {
- $row = $result;
- $noSell = $row['noSell'];
- $noSell = str_replace(",", "&noSell[]=", $noSell);
- $noSell = "&noSell[]=" . $noSell;
- if ($row['credits'] <= 0) {
- output("No credits remaining.");
- die(sleep(65));
- }
- //Generates the settings from the database to a parseable string for php to read from
- $par = "id=" . $row['id'] . "&maxCoke=" . $row['maxCoke'] . "&credits=" . $row['credits'] .
- "&doNarcs=" . $row['doNarcs'] . "&shootBottle=" . $row['shootBottle'] .
- "&sellPoint=" . $row['sellPoint'] . "&useCache=" . $row['cache'] . "&doBooze=" .
- $row['doBooze'] . "&boozeRuns=" . $row['boozeRuns'] . "&doSelfBO=" . $row['doSelfBO'] .
- "&maxBulletPrice=" . $row['maxBulletPrice'] . "&minAmmountBullets=" . $row['minAmmountBullets'] .
- "&minBulletMoney=" . $row['minBulletMoney'] . "&onlyBust=" . $row['onlyBust'] .
- "&waitBust=" . $row['waitBust'] . "&doBullets=" . $row['doBullets'] .
- "&betRoul=" . $row['betRoul'] . "&numberRoul=" . $row['numberRoul'] .
- "&gamble_roul=" . $row['gamble_roul'] . "&roulMin=" . $row['roulMin'] .
- "&maxBloodPrice=" . $row['maxBloodPrice'] . "&minBloodBuy=" . $row['minBloodBuy'] .
- "&minBloodMoney=" . $row['minBloodMoney'] . "&doBlood=" . $row['doBlood'] .
- "&sleepingM=" . $row['sleepingM'] . "&sleepingH=" . $row['sleepingH'] .
- "&sleepingT=" . $row['sleepingT'] . "&maxBuyOut=" . $row['maxBuyOut'] .
- "&doRange=" . $row['doRange'] . "&maxRangeCost=" . $row['maxRangeCost'] .
- "&buyGun=" . $row['buyGun'] . $noSell;
- parse_str($par, $settings); //parses the above string into the settings array
- if (file_exists('user_pass.txt')) {
- $up = explode(':', file_get_contents('user_pass.txt'));
- $settings['omertaUser'] = $up[0];
- $settings['omertaPass'] = $up[1];
- } else
- createUserPassFile();
- if (($settings['omertaUser'] == "") && ($settings['omertaPass'] == "")) {
- output("Omerta user not setup yet.");
- output("Please login @ $GLOBALS[scriptURL]");
- output("And setup your omerta user.");
- while (true) {
- sleep(10);
- die();
- } //while
- } //if
- //Setting proxy information
- $settings['proxy'] = $proxy;
- $settings['pAuth'] = $pAuth;
- $settings['sPass'] = $sPass;
- //Setting sleeping
- if ($settings['sleepingT'] > 0) {
- $year = date("Y", time());
- $day = date("j", time());
- $month = date("m", time());
- $startSleep = mktime($settings['sleepingH'], $settings['sleepingM'], 0, $month,
- $day, $year);
- if ($startSleep < time()) {
- $startSleep = mktime($settings['sleepingH'], $settings['sleepingM'], 0, $month,
- $day + 1, $year);
- }
- }
- //Setting crime action
- if ($settings['shootBottle'] == "1") {
- $settings['crimeAction'] = "chancebottle";
- } //end if
- else {
- $settings['crimeAction'] = "chance5";
- } //end else
- //Sets booze action if there is a problem with user choices
- if ($settings['boozeRuns'] == '1' && $settings['doBooze'] == '1') {
- $settings['boozeRuns'] = '1';
- $settings['doBooze'] = '';
- } //if
- //displays the sessionf or user at start of script
- foreach ($settings as $key => $val) {
- if (!(($key == "id") || ($key == "proxy") || ($key == "noSell") || ($key ==
- "pAuth"))) {
- //echo "\t$key => $val\n";
- }
- }
- //defaults some settings so there are no errors later on
- $settings['cache'] = '';
- $settings['currentCity'] = "";
- $settings['curCity'] = "";
- $settings['frequency'] = 5; //number of minutes between status page check
- $settings['skipNarc'] = false;
- } else {
- output("cript Username is incorrect.");
- unlink('settings.cfg'); //if settings are wrong delete settings
- die(output("Incorrect Login, deleting settings"));
- } //else
- } //parseSettings()
- function login2Omerta()
- {
- global $settings, $omerta, $vers;
- $loginPage = get($vers['omertaURL'], $vers['omertaURL']);
- $checkString = array("<form method=\"post\" action=\"game-login.php\">",
- "<input type='text' style='width: 90; font-family: Verdana; font-size: 10px; background-color: #303030; color: #CCCCCC; border: 1px solid #FFFFFF' name='name'>",
- "<input type='password' style='width: 90; font-family: Verdana; font-size: 10px; background-color: #303030; color: #CCCCCC; border: 1px solid #FFFFFF' name='pass'>"); //Three Lines to ensure the login hasn't changed.
- if (!((inStr($checkString[0], $loginPage)) && (inStr($checkString[1], $loginPage)) &&
- (inStr($checkString[2], $loginPage)))) {
- $loginPage = removeBetween('<!--', '-->', $loginPage);
- $loginPage = str_replace('./', '', $loginPage);
- $session_alive[] = '<frame name="menu" src="menu.php"';
- //$session_alive[] = '<frame name="main" src="main.php"';
- $session_alive[] = '<frame name="info" src="info.php"';
- if (!(inStrArray($session_alive, $loginPage))) {
- output("Problem with Login page");
- write2file("newLogin.html", $loginPage);
- write2file("loginMD5.txt", md5($loginPage));
- sleep(20);
- die();
- } //end if
- else {
- output("Omerta User = " . $settings['omertaUser'], "Login");
- output("Omerta Pass = " . $settings['omertaPass'], "Login");
- if (inStr('<frame name="main" src="main.php"', $loginPage))
- get($vers['omertaURL'] . "main.php", $vers['omertaURL'] . "game.php");
- elseif (inStr('<frame name="main" src="usms.php"', $loginPage))
- get($vers['omertaURL'] . "usms.php", $vers['omertaURL'] . "game.php");
- else {
- output("Unknown main frame, possible script trap.");
- sleep(10);
- die();
- }
- } //end else
- } else {
- output("Omerta User - " . $settings['omertaUser'], "Login");
- output("Omerta Pass - " . $settings['omertaPass'], "Login");
- $settings['omertaUser'] = trim($settings['omertaUser']);
- $settings['omertaPass'] = trim($settings['omertaPass']);
- $pst = "name=$settings[omertaUser]&pass=$settings[omertaPass]";
- $loginPage = post($vers['omertaURL'] . "game-login.php", $vers['omertaURL'], $pst);
- $loginPage = removeBetween('<!--', '-->', $loginPage);
- $loginPage = str_replace('./', '', $loginPage);
- $session_alive[] = '<frame name="menu" src="menu.php"';
- //$session_alive[] = '<frame name="main" src="main.php"';
- $session_alive[] = '<frame name="info" src="info.php"';
- if (!(inStrArray($session_alive, $loginPage))) {
- write2file("checkLogin.html", $loginPage . "\n\n\n" . md5($loginPage));
- output("Login failed.", "Login");
- sleep(20);
- die();
- } //end if
- if (inStr('<frame name="main" src="main.php"', $loginPage))
- get($vers['omertaURL'] . "main.php", $vers['omertaURL'] . "game.php");
- elseif (inStr('<frame name="main" src="usms.php"', $loginPage))
- get($vers['omertaURL'] . "usms.php", $vers['omertaURL'] . "game.php");
- else {
- output("Unknown main frame, possible script trap.");
- sleep(10);
- die();
- }
- } //end else
- loadOmertaAfterLogin();
- output("Login Sucessful", "Login");
- forceCookies();
- }
- function loadOmertaAfterLogin()
- {
- global $settings, $vers;
- //Banner
- $res = get($vers['omertaURL'] . "banner.php", $vers['omertaURL'] . "game.php");
- $res = removeBetween('<!--', '-->', $res);
- $res = str_replace('./', '', $res);
- $bannerCheck[] = '<frame name="l" src="pic.php"';
- $bannerCheck[] = '<frame name="mail" src="mailbox.php" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" noresize="noresize" />';
- $bannerCheck[] = '<frame name="m" src="mid.php"';
- $bannerCheck[] = '<frame name="r" src="right.php"';
- if (!(inStrArray($bannerCheck, $res))) {
- output("Change spotted in banner.php", "Login");
- write2file("bc.hmtl", $res . "\r\n" . $res);
- sleep(20);
- die();
- }
- //output("Banner.php loaded","Login");
- get($vers['omertaURL'] . "pic.php", $vers['omertaURL'] . "banner.php");
- get($vers['omertaURL'] . "mid.php", $vers['omertaURL'] . "banner.php");
- get($vers['omertaURL'] . "mailbox.php", $vers['omertaURL'] . "banner.php");
- get($vers['omertaURL'] . "right.php", $vers['omertaURL'] . "banner.php");
- get($vers['omertaURL'] . "marquee.php", $vers['omertaURL'] . "banner.php");
- parsePages();
- $settings['newsRefresh'] = 1800;
- $settings['lastBanner'] = time();
- $settings['lastMail'] = time();
- $settings['lastNews'] = time();
- get($vers['omertaURL'] . "info.php", $vers['omertaURL'] . "game.php");
- get($vers['omertaURL'] . "main.php", $vers['omertaURL'] . "game.php");
- } //loadOmertaAfterLogin()
- function status()
- {
- //displayStats();
- //saveStats();
- echo "\r\n";
- global $omerta, $settings;
- global $scriptSite;
- getinbox();
- global $omerta;
- $res = get($omerta['status'], $omerta['menu']);
- $res_org = $res;
- write2file("../status.html", $res);
- upload("../status.html", "status.html");
- parseStatus($res);
- checkVote();
- }
- function parseStatus($res)
- {
- $res_org = $res;
- check4update();
- global $settings, $omerta, $argu, $omerta, $timer, $priceChangeTime, $priceChange, $priceSec, $vers;
- checkEnglish($res);
- $rp = trim(getBetween(strtolower(html2text($res)), $vers['text']['gress'], $vers['text']['health']));
- $rank = trim(substr(trim(getBetween(strtolower($res), '<td><b>'.$vers['text']['rank'].'</b></td>', '</td>')), 4));
- $settings['rank'] = $rank;
- //bnrank();
- $cash = trim(substr($res, strpos($res, $vers['text']['Cash'] . "</b></td>") + 13,
- 50));
- $cash = substr($cash, 0, strpos($cash, "</td>"));
- $cash = str_replace("<td>", '', $cash);
- $cash = str_replace("$", '', $cash);
- $cash = str_replace(",", '', $cash);
- $cash = trim(str_replace(" ", '', $cash));
- $res2 = html2text($res);
- $ks = str_replace('%', '', trim(getBetween($res2, $vers['text']['Killing skill'],
- $vers['text']['Jailbusting Skill'])));
- $family = trim(getBetween($res2, $vers['text']['Family'], $vers['text']['Capo'])) .
- "\n\t\n"; //using /n/t/n as a delimiter for end of line, not sure if PHP has anything so did it myself :)
- if ($family{0} == '[')
- $family = trim(getBetween($family, ']', "\n\t\n")); //If there is a link, get the family, no link ... no link = Famless
- $family = trim($family);
- $settings['credits'] = getDB('credits','id',$settings['id']);
- output("R:" . $settings['rank'] . "||RP:".$rp."||KS:".$ks."||C:".$cash."||F:".$family."||C:".$settings['credits']."\n", "Status",false);
- /*output("Rank: " . $settings['rank'] . " // RP: $rp " . "// Cash: " . $cash,
- "Status");
- output("KS: $ks // Family: $family // Credits: " . $settings['credits'],
- 'Status'); */
- $level = trim(getBetween(getBetween($res, '<td><b>' . $vers['text']['Level'] .
- '</b></td>', '<td><b>' . $vers['text']['Start']), '<td>', '</td>'));
- if (inStr('<', $level))
- $level = trim(substr($level, 0, strpos($level, '<')));
- if (rand(1, 5) == 1) {
- setDB('family', $family, 'id', $settings['id']);
- setDB('omertaUser', $settings['omertaUser'], 'id', $settings['id']);
- setDB('killskill', $ks, 'id', $settings['id']);
- setDB('rank', $settings['rank'], 'id', $settings['id']);
- setDB('level', $level, 'id', $settings['id']);
- }
- sleep(rand(1, 3));
- $credits = getDB('credits', 'id', $settings['id']);
- if ($credits <= 0) {
- output("No credits.");
- die(sleep(30));
- }
- if (!inStr('Tommy', $res) && $settings['buyGun'] == '1') {
- if ($cash > 36000) {
- buyGun();
- output("Purchased Tommy Gun", "Shop");
- queryDB("UPDATE users SET shootBottle='1' WHERE id='" . $settings['id'] . "'");
- die();
- }
- }
- $start = '<td><a href="travel.php">';
- $end = '</a></td>';
- $place = findinside($start, $end, $res);
- $settings['curCity'] = str_replace(" ", "", $place[1]);
- if (!((inStr("Tommy", $res)) || (inStr(".45 Colt", $res)))) {
- $settings['crimeAction'] = "chance5";
- }
- if ($settings['crimeAction'] != 'chance5' && ($ks == '100')) {
- output('You have reached 100% KS, disabled bottle', 'Status');
- $settings['crimeAction'] = 'chance5';
- }
- //print_r($argv);
- if (isset($argu['dsw']) && isset($argu['dsw'][0]) && isset($argu['dsw'][1]))
- checkSW($cash);
- $replace = array("\n", "\r", "\t", " ", );
- $rn = str_replace($replace, '', $res);
- $minute = strftime("%M");
- if ((($minute >= 0) && ($minute <= 25)) || (($minute >= 30) && ($minute <= 55))) {
- if ((!(inStr("<td><b>" . $vers['text']['Plane'] . "</b></td><td>" . $vers['text']['None'] .
- "</td>", $res))) && ($settings['doNarcs'] == 1) && (inStr("<ahref=\"travel.php\"><b>" .
- $vers['text']['Nextflight'] . "</b></a></td><td><ahref=\"travel.php\">Now</a></td>",
- $rn))) {
- $ress = get($omerta['smuggling'], $omerta['menu']);
- $cokeAmmount = getAmmount($ress, $vers['text']['Cocaine']);
- if ($cokeAmmount == 0) {
- if ($cash > $settings['maxCoke'] * $settings['narcAmmount'] + (24000 * 2)) {
- $ccprice = getPrice(get($omerta['smuggling'], $omerta['menu']), $vers['text']['Cocaine']);
- if (is_numeric($ccprice))
- output($ccprice, "Current City");
- elseif (inStr("src=/static/images/game/generic/criminal.jpg", $ress)) {
- output('In Jail, Narcs postponed 5 minutes');
- return;
- }
- if ($ccprice <= $settings['maxCoke']) {
- if ($settings['boozeRuns'] == '1') {
- if ($cash - ($settings['maxCoke'] * $settings['narcAmmount'] + (24000 * 2)) >= ($settings['boozeAmmount'] *
- 2100)) {
- buyCocaine(true);
- return true;
- } else {
- output("Not enough cash for rum.", "Booze");
- buyCocaine();
- return true;
- }
- } else {
- buyCocaine();
- return true;
- }
- } else {
- $res = getHighLow();
- $res = str_replace('wY', 'w Y', $res);
- $res = str_replace('sV', 's V', $res);
- $city = get_between($res, "<low>", "</low>");
- $price = get_between($res, "<$city>", "</$city>");
- if (trim($price) == "" || $price > 28000) {
- output("Cannot read prices.", "Narcs");
- $settings['skipNarc'] = true;
- } else {
- output($city . " ($price)", "Low");
- if ($price > $settings['maxCoke']) {
- output("Too expensive.", "Narcs");
- $settings['skipNarc'] = true;
- } else {
- $settings['skipNarc'] = false;
- if (!travel($city)) {
- output("Travel Trap detected.", "Travel");
- } else {
- if ($settings['boozeRuns'] == '1') {
- if ($cash - ($settings['maxCoke'] * $settings['narcAmmount'] + (24000 * 2)) >= ($settings['boozeAmmount'] *
- 2100)) {
- buyCocaine(true);
- return true;
- } else {
- output("Not enough cash for rum.", "Booze");
- buyCocaine();
- return true;
- }
- } else {
- buyCocaine();
- return true;
- }
- }
- }
- }
- }
- } else {
- output("Not enough cash for narcs.", "Narcs");
- $settings['skipNarc'] = true;
- }
- } elseif ($cokeAmmount > 0) {
- if ($cash > (24000)) {
- $res = getHighLow();
- $res = str_replace('wY', 'w Y', $res);
- $res = str_replace('sV', 's V', $res);
- $city = get_between($res, "<high>", "</high>");
- $price = get_between($res, "<$city>", "</$city>");
- if (trim($price) == "" || $price > 28000) {
- output("Cannot read prices.", "Narcs");
- } else {
- if (trim($price) <= 20000) {
- output("Cheap high");
- $settings['skipNarc'] = true;
- } else {
- $settings['skipNarc'] = false;
- output($city . " ($price)", "High");
- output($city, "Narcs");
- if (!travel($city)) {
- output("Travel Trap detected.", "Travel");
- } else {
- sellStuff(true);
- }
- }
- }
- } else {
- output("Not enough cash for narcs.", "Narcs");
- $settings['skipNarc'] = true;
- }
- } else {
- output("Omerta is bugged.", 'Smuggling');
- $settings['skipNarc'] = true;
- }
- }
- }
- $res = $res_org;
- if (inStr("<b>" . $vers['text']['Booze'] . "</b></a></td><td>" . $vers['text']['Now'],
- $rn) && ($settings['doBooze'] == 1)) {
- if (!($cash > ($settings['boozeAmmount'] * 300))) {
- output("Not enough cash for booze.", "Booze");
- } else {
- output("Performing hourly booze.", "Booze");
- booze();
- }
- }
- $res = $res_org;
- if ($settings['doBlood'] == '1') {
- $missing = (100 - parseHealth($res));
- if (($cash > $settings['minBloodMoney']) && (inStr('<td><a href="bloodbank.php">' .
- $vers['text']['Now'] . '</a></td>', $res)) && ($missing >= $settings['minBloodBuy']) &&
- ($settings['minBloodBuy'] > 0)) {
- buyBlood($missing);
- return;
- }
- }
- $res = $res_org;
- if ($settings['doRange'] == '1' && inStr('<td><a href="shootingrange.php">' . $vers['text']['Now'] .
- '</a></td>', $res_org) && $cash > 10000) {
- $ks = floor($ks);
- switch ($ks) {
- case (floor($ks) < 10):
- //output("Killing skill too low for shooting range", "Range");
- break;
- case (floor($ks) < 30):
- //10-29.9 Beginner Chest
- output("Shooting Beginner target's Chest", "Range");
- $post[] = "stage=enter&x=" . rand(20, 65) . "&y=" . rand(20, 65);
- $post[] = "stage=select&target=low&x=" . rand(25, 110) . "&y=" . rand(50, 150);
- $post[] = "stage=shoot&target=3&sub=1&x=" . rand(20, 65) . "&y=" . rand(20, 65);
- break;
- case (floor($ks) < 40):
- //30-39.9 Beginner Head
- output("Shooting Beginner target's Head", "Range");
- $post[] = "stage=enter&x=" . rand(20, 65) . "&y=" . rand(20, 65);
- $post[] = "stage=select&target=low&x=" . rand(25, 110) . "&y=" . rand(50, 150);
- $post[] = "stage=shoot&target=3&sub=2&x=" . rand(20, 65) . "&y=" . rand(20, 65);
- break;
- case (floor($ks) < 50):
- //40-49.9 Intermediate Chest
- output("Shooting Intermediate target's Chest", "Range");
- $post[] = "stage=enter&x=" . rand(20, 65) . "&y=" . rand(20, 65);
- $post[] = "stage=select&target=mid&x=" . rand(25, 110) . "&y=" . rand(50, 150);
- $post[] = "stage=shoot&target=2&sub=1&x=" . rand(20, 65) . "&y=" . rand(20, 65);
- break;
- case (floor($ks) < 70):
- //50-59.9 Intermediate Head
- output("Shooting Intermediate target's Head", "Range");
- $post[] = "stage=enter&x=" . rand(20, 65) . "&y=" . rand(20, 65);
- $post[] = "stage=select&target=mid&x=" . rand(25, 110) . "&y=" . rand(50, 150);
- $post[] = "stage=shoot&target=2&sub=2&x=" . rand(20, 65) . "&y=" . rand(20, 65);
- break;
- case (floor($ks) < 80):
- //60-60.9 Advanced Chest
- output("Shooting Advanced target's Chest", "Range");
- $post[] = "stage=enter&x=" . rand(20, 65) . "&y=" . rand(20, 65);
- $post[] = "stage=select&target=high&x=" . rand(25, 110) . "&y=" . rand(50, 150);
- $post[] = "stage=shoot&target=1&sub=1&x=" . rand(20, 65) . "&y=" . rand(20, 65);
- break;
- case (floor($ks) < 80):
- //70-79.9 Advanced Head
- output("Shooting Advanced target's Head", "Range");
- $post[] = "stage=enter&x=" . rand(20, 65) . "&y=" . rand(20, 65);
- $post[] = "stage=select&target=high&x=" . rand(25, 110) . "&y=" . rand(50, 150);
- $post[] = "stage=shoot&target=1&sub=2&x=" . rand(20, 65) . "&y=" . rand(20, 65);
- break;
- case (floor($ks) >= 80):
- //output("Killing skill too high for shooting range", "Range");
- break;
- default:
- output("Killing skill not valid for range", "Range");
- break;
- } //switch
- if (isset($post[1]))
- doRange($cash, $post);
- } //if doRange
- $res = $res_org;
- if ($settings['doBullets'] == '1') {
- //if ((inStr('Donating', $res)) || (inStr('User group', $res))) {
- if (true) {
- if (($cash > $settings['minBulletMoney']) && (inStr('<td><a href="bullets2.php">' .
- $vers['text']['Now'] . '</a></td>', $res))) {
- output("Starting Bullets", "Bullet");
- while (buyBullets()) {
- if (($timer['crime'] <= time())) {
- while (crime() == false) {
- checkRefresh();
- sleep(rand(1, 5));
- }
- }
- if (($timer['nick'] <= time())) {
- while (carNick() == false) {
- checkRefresh();
- sleep(rand(1, 5));
- }
- sleeping(); #Check for sleep
- }
- global $nextCheck;
- if (time() > $nextCheck) {
- break; //leave loop and return to normal play (so it gets status again)
- }
- sleeping(); #Check for sleep
- #sleep(rand(5, 9)); //buyBullets return true if it should loop again
- sleep(1);
- }
- return;
- }
- }
- } // end bullets
- if ($settings['gamble_roul'] == '1') {
- if (rand(1, 5) == 1) {
- if ($cash > $settings['roulMin']) {
- openGamble();
- return;
- }
- } // rand roul
- } // roullete
- }
- function iaminjail()
- {
- global $settings, $timer;
- if (($timer['iaminjail'] <= time())) {
- $fp = fopen("injail.txt", "w");
- fwrite($fp, $settings['curCity']);
- fclose($fp);
- $timer['iaminjail'] = (time() + rand(231, 399));
- }
- } //close iaminjail()
- function playOmerta()
- {
- @unlink('../logs/current.txt');
- global $crimeRun, $settings, $omerta, $timer, $nextCheck, $vers;
- $res = get($omerta['smuggling'], $omerta['menu']);
- if (getAmmount($res, strtolower($vers['text']['Cocaine'])) != 0) {
- $settings['haveCoke'] = true;
- } else {
- $settings['haveCoke'] = false;
- }
- $nextCheck = time() + ($settings['frequency'] * 60);
- status();
- $res = get($omerta['status'], $omerta['menu']);
- $t = getTimers($res);
- $timer['nick'] = time() + $t['nick'];
- $timer['crime'] = time() + $t['crime'];
- $timer['flight'] = time() + $t['flight'];
- while (true) {
- sleeping(); #Check for sleep
- checkRefresh();
- getCommands();
- if (!$settings['onlyBust'] == 1) {
- if (($settings['skipNarc'] == false) && ($timer['flight'] <= time()) && $settings['doNarcs'] ==
- 1) {
- output("Beginning narc run.", 'Smuggling');
- status();
- }
- if (($timer['crime'] <= time())) {
- output("Crime started.");
- while (crime() == false) {
- checkRefresh();
- sleep(rand(1, 3));
- }
- $res = get($omerta['status'], $omerta['menu']);
- $t = getTimers($res);
- $timer['nick'] = time() + $t['nick'];
- $timer['crime'] = time() + $t['crime'];
- $timer['flight'] = time() + $t['flight'];
- }
- if (($timer['nick'] <= time())) {
- output("Car Nick Started");
- while (carNick() == false) {
- checkRefresh();
- sleep(rand(1, 3));
- }
- $res = get($omerta['status'], $omerta['menu']);
- $t = getTimers($res);
- $timer['nick'] = time() + $t['nick'];
- $timer['crime'] = time() + $t['crime'];
- $timer['flight'] = time() + $t['flight'];
- }
- if ((!$timer['nick'] <= time()) && (!$timer['crime'] <= time()) && ($settings['waitBust'] ==
- 1)) {
- checkRefresh();
- doBust();
- } elseif ((!$timer['nick'] <= time()) && (!$timer['crime'] <= time()) && ($settings['waitBust'] ==
- 2)) {
- if (rand(1, 24) == 1) {
- sleep(rand(1, 5));
- checkRefresh();
- doBust();
- }
- }
- } else {
- checkRefresh();
- doBust();
- }
- if (time() > $nextCheck) {
- $nextCheck = time() + ($settings['frequency'] * 60);
- status();
- }
- //getCommands();
- sleep(1);
- } //wend
- } //playOmerta()
- function clicklimitCheck($res, $url = "dummy")
- {
- global $vers;
- if (inStr($vers['text']['clicklimit'], $res) && !inStr('<td>', strtolower($res)) && $vers != "") {
- output("Clicklimit reached");
- return 0;
- } else {
- return 1;
- }
- }
- function verifyNickInputs($res)
- {
- //count radio inputs
- $num = substr_count($res, "<input type=\"radio\"");
- if ($num != 4) {
- output("Error: (radio)[$num]", "Car Nick");
- write2file("nickChange.html", $res);
- sleep(10);
- die();
- }
- //count hidden inputs
- $num = substr_count($res, "<input type=\"hidden\"");
- if ($num != 1) {
- output("Error: (hidden)[$num]", "Car Nick");
- write2file("nickChange.html", $res);
- sleep(10);
- die();
- }
- //count text inputs
- $num = substr_count($res, "<input type=\"text\"");
- if ($num != 1) {
- output("Error: (text)[$num]", "Car Nick");
- write2file("nickChange.html", $res);
- sleep(10);
- die();
- }
- //count submit inputs
- $num = substr_count($res, "<input type=\"submit\"");
- if ($num != 1) {
- output("Error: (submit)[$num]", "Car Nick");
- write2file("nickChange.html", $res);
- sleep(10);
- die();
- }
- //Count total inputs
- $num = substr_count($res, "<input type=");
- if ($num != 7) {
- output("Error: (total)[$num]", "Car Nick");
- write2file("nickChange.html", $res);
- sleep(10);
- die();
- }
- } //verifyCrimeInputs()
- function verifyCrimeInputs($res)
- {
- //count radio inputs
- $num = substr_count($res, "<input type=\"radio\"");
- if ($num != 6) {
- output("Error: (radio)[$num]", "Crime");
- write2file("crimeChange.html", $res);
- sleep(10);
- die();
- }
- //count hidden inputs
- $num = substr_count($res, "<input type=\"hidden\"");
- if ($num != 1) {
- output("Error: (hidden)[$num]", "Crime");
- write2file("crimeChange.html", $res);
- sleep(10);
- die();
- }
- //count text inputs
- $num = substr_count($res, "<input type=\"text\"");
- if ($num != 1) {
- output("Error: (text)[$num]", "Crime");
- write2file("crimeChange.html", $res);
- sleep(10);
- die();
- }
- //count submit inputs
- $num = substr_count($res, "<input type=\"submit\"");
- if ($num != 1) {
- output("Error: (submit)[$num]", "Crime");
- write2file("crimeChange.html", $res);
- sleep(10);
- die();
- }
- //Count total inputs
- $num = substr_count($res, "<input type=");
- if ($num != 9) {
- output("Error: (total)[$num]", "Crime");
- write2file("crimeChange.html", $res);
- sleep(10);
- die();
- }
- } //verifyCrimeInputs()
- function crimePost($res)
- {
- global $settings;
- if (!(inStr("value=\"Yes\"", $res))) {
- output("Hidden value changed", "Crimes");
- sleep(5);
- die();
- } //end if
- //Hidden input value and name
- $hiddenValue = "Yes";
- $position = strpos($res, "value=\"Yes\"");
- $hiddenName = trim(substr($res, $position - 14, 13));
- if (!(($hiddenName{0} == "=") && ($hiddenName{strlen($hiddenName) - 1} == '"'))) {
- output("Unable to get hidden name, crimes page changes", "Crimes");
- write2file("crimeChange.html", $res);
- sleep(5);
- die();
- } //end if
- $hiddenName = str_replace("=", '', $hiddenName);
- $hiddenName = str_replace('"', '', $hiddenName);
- //Radio input value and name
- $radioValue = $settings['crimeAction'];
- $position = strpos($res, "value=\"" . $radioValue . "\"");
- $radioName = trim(substr($res, $position - 14, 13));
- if (!(($radioName{0} == "=") && ($radioName{strlen($radioName) - 1} == '"'))) {
- output("Unable to get radio name, crimes page changes", "Crimes");
- write2file("crimeChange.html", $res);
- sleep(5);
- die();
- } //end if
- $radioName = str_replace("=", '', $radioName);
- $radioName = str_replace('"', '', $radioName);
- //text input value and name
- //$textValue = "Yes";
- $position = strpos($res, "size=\"3\"");
- $textName = trim(substr($res, $position - 14, 13));
- if (!(($textName{0} == "=") && ($textName{strlen($textName) - 1} == '"'))) {
- output("Unable to get hidden name, crimes page changes", "Crimes");
- write2file("crimeChange.html", $res);
- sleep(5);
- die();
- } //end if
- $textName = str_replace("=", '', $textName);
- $textName = str_replace('"', '', $textName);
- $post = "$hiddenName=$hiddenValue&$radioName=$radioValue&$textName=";
- $code = readCode();
- if ($code == "~bc") {
- output("Unviewable captha, reloading site", "Code");
- crime();
- }
- $code = str_replace('-', '', $code);
- $code = str_replace('~', '', $code);
- if (strlen($code) != 3) {
- return $code;
- }
- $post = "$hiddenName=$hiddenValue&$radioName=$radioValue&$textName=" . $code;
- return $post;
- } //crimePost()
- function carNickPost($res)
- {
- global $settings;
- if (!(inStr("value=\"Yes\"", $res))) {
- output("HIdden value changed", "Car Nick");
- sleep(10);
- die();
- } //end if
- //Hidden input value and name
- $hiddenValue = "Yes";
- $position = strpos($res, "value=\"Yes\"");
- $hiddenName = trim(substr($res, $position - 14, 13));
- if (!(($hiddenName{0} == "=") && ($hiddenName{strlen($hiddenName) - 1} == '"'))) {
- output("Unable to get hidden name, nick page changes", "Nick");
- write2file("nickChange.html", $res);
- sleep(5);
- die();
- } //end if
- $hiddenName = str_replace("=", '', $hiddenName);
- $hiddenName = str_replace('"', '', $hiddenName);
- //Radio input value and name
- $radioValue = bestChanceNick($res);
- $position = strpos($res, "value=\"" . $radioValue . "\"");
- $radioName = trim(substr($res, $position - 14, 13));
- if (!(($radioName{0} == "=") && ($radioName{strlen($radioName) - 1} == '"'))) {
- output("Unable to get radio name, nick page changes", "Nick");
- write2file("nickChange.html", $res);
- sleep(5);
- die();
- } //end if
- $radioName = str_replace("=", '', $radioName);
- $radioName = str_replace('"', '', $radioName);
- //text input value and name
- //$textValue = "Yes";
- $position = strpos($res, "size=\"3\"");
- $textName = trim(substr($res, $position - 14, 13));
- if (!(($textName{0} == "=") && ($textName{strlen($textName) - 1} == '"'))) {
- output("Unable to get hidden name, crimes page changes", "Crimes");
- write2file("nickChange.html", $res);
- sleep(5);
- die();
- } //end if
- $textName = str_replace("=", '', $textName);
- $textName = str_replace('"', '', $textName);
- $post = "$hiddenName=$hiddenValue&$radioName=$radioValue&$textName=";
- $code = readCode();
- if ($code == "~bc") {
- output("Unviewable captha, reloading site", "Code");
- carNick();
- }
- $code = str_replace('-', '', $code);
- $code = str_replace('~', '', $code);
- if (strlen($code) != 3) {
- return $code;
- }
- $post = "$hiddenName=$hiddenValue&$radioName=$radioValue&$textName=" . $code;
- return $post;
- } //crimePost()
- function saveCaptcha($res, $ref)
- {
- global $vers;
- if (!(inStr("/im-no-cheater/?id=", $res))) {
- write2file('../noCaptcha.html', $res);
- die(output("Unable to save captcha."));
- } //end if
- $imageURL = substr($res, strpos($res, "/im-no-cheater/?id=") + 18); //Find start position of image code, add 28 to get to end
- $imageURL = substr($imageURL, 0, strpos($imageURL, "\">")); //find end of id
- $imageURL = ereg_replace( '[^0-9]+', '',$imageURL);
- $imageCheck = "im-no-cheater/?id=$imageURL";
- $imageURL = $vers['omertaURL'] . "im-no-cheater/?id=$imageURL";
- if (!inStr($imageCheck, $res)) {
- write2file('wrongCaptcha.html', $res);
- die(output("Captcha URL incorrect, restarting. . ."));
- }
- write2file('ccc.png', get($imageURL, $ref));
- }
- function getBody($res)
- {
- $out = substr($res, strpos($res, "<body>") + 6);
- $out = substr($out, 0, strpos($out, "</body>"));
- $out = str_replace("<font color=\"blue\">", "", $out);
- $out = str_replace("</font>", "", $out);
- $out = clearParse($out);
- return $out;
- }
- function carNick()
- {
- global $omerta, $settings, $scriptSite, $stats, $vers;
- $res = get($omerta['carNick'], $omerta['menu']);
- stillLoggedIn($res);
- $res = removeBetween('<--', '-->', $res);
- $res = removeBetween('<!--', '-->', $res);
- if (!(inStr($vers['text']['tired'], $res) || inStr("src=/static/images/game/generic/criminal.jpg",
- $res))) {
- verifyNickInputs($res);
- saveCaptcha($res, $omerta['carNick']);
- $post = carNickPost($res);
- if (strlen($post) <= 5) {
- //output('No Typers. . .', 'Car Nicks');
- return 1;
- }
- $res = str_replace("action=\"" . $GLOBALS['vers']['omertaURL_NS'] . "", "action=\"",
- $res);
- if (!(inStr("<form name=\"car\" action=\"/BeO/webroot/index.php?module=Cars&action=docar\" method=\"post\">",
- $res))) {
- //CHANGE !ACTION
- write2file('nickAction.html', $res);
- output("Form Action changed detected.", "Car Nick");
- sleep(10);
- die();
- }
- $action = $GLOBALS['vers']['omertaURL_NS'] .
- "/BeO/webroot/index.php?module=Cars&action=docar";
- $res = post($action, $omerta['carNick'], $post);
- if (inStr($vers['text']['Jail'], $res) || inStr("src=/static/images/game/generic/criminal.jpg",
- $res)) {
- output("You have been caught.", "Car Nick");
- $stats['nick']['total']++;
- $stats['nick']['caught']++;
- $stats['nick']['failed']++;
- global $timer;
- $timer['nick'] = (time() + 302);
- doSelfBust($res);
- return 1;
- } //end if
- elseif (inStr($vers['text']['The code you'], $res)) {
- wrongCode();
- return false;
- } //end elseif
- else {
- global $timer;
- $timer['nick'] = (time() + 302);
- parseNickResults($res, $action);
- return 1;
- } //end else
- } else {
- if (inStr("src=/static/images/game/generic/criminal.jpg", $res)) {
- iaminjail();
- output("In Jail.", "Car Nick");
- doSelfBust($res);
- } else {
- //output("To early. . .", "Car Nick");
- }
- global $timer;
- $timer['nick'] = (time() + 13);
- return true;
- }
- global $timer;
- $timer['nick'] = (time() + 13);
- return true;
- }
- function crime()
- {
- checkRefresh();
- global $omerta, $settings, $scriptSite, $crimeRun, $stats, $vers;
- $res = get($omerta['crimes'], $omerta['menu']);
- stillLoggedIn($res);
- $res = removeBetween('<--', '-->', $res);
- $res = removeBetween('<!--', '-->', $res);
- if (!(inStr($vers['text']['tired'], $res) || inStr("src=/static/images/game/generic/criminal.jpg",
- $res))) {
- verifyCrimeInputs($res);
- saveCaptcha($res, $omerta['crimes']);
- $post = crimePost($res);
- if (strlen($post) < 4) {
- output("No Typers.");
- return false;
- }
- $res = str_replace("action=\"" . $GLOBALS['vers']['omertaURL_NS'], "action=\"",
- $res);
- if (!(inStr("<form name=\"crime\" action=\"/BeO/webroot/index.php?module=Crimes&action=docrime\" method=\"post\">",
- $res))) {
- output("Form action has changed.", "Crimes");
- write2file('crimeAction.html', $res);
- sleep(10);
- die();
- }
- if (strlen($post) <= 5) {
- output('No Typers.', 'Crime');
- return false;
- }
- $res = post($GLOBALS['vers']['omertaURL_NS'] .
- "/BeO/webroot/index.php?module=Crimes&action=docrime", $omerta['crimes'], $post);
- if (inStr($vers['text']['tired'], $res) || inStr("src=/static/images/game/generic/criminal.jpg",
- $res)) {
- output("You have been caught!", "Crimes");
- $stats['crimes']['total']++;
- $stats['crimes']['caught']++;
- $stats['crimes']['failed']++;
- global $timer;
- $timer['crime'] = (time() + 102);
- doSelfBust($res);
- } //end if
- elseif (inStr($vers['text']['made'], $res)) {
- $out = getBody($res);
- output($out, "Crimes");
- $stats['crimes']['total']++;
- $stats['crimes']['successful']++;
- global $timer;
- $timer['crime'] = (time() + 102);
- } //end elseif
- elseif (inStr($vers['text']['done'], $res)) {
- output("Successfully hit the bottle.", "Crimes");
- global $timer;
- $stats['crimes']['total']++;
- $stats['crimes']['successful']++;
- $timer['crime'] = (time() + 102);
- } //end elseif
- elseif (inStr($vers['text']['foot'], $res)) {
- output("You shot your foot!", "Crimes");
- global $timer;
- $stats['crimes']['total']++;
- $stats['crimes']['foot']++;
- $stats['crimes']['failed']++;
- $timer['crime'] = (time() + 102);
- } //end elseif
- elseif (inStr($vers['text']['The code you'], $res)) {
- wrongCode();
- return false;
- } //end elseif
- else {
- output("Failed.", "Crimes");
- $stats['crimes']['total']++;
- $stats['crimes']['failed']++;
- global $timer;
- $timer['crime'] = (time() + 102);
- } //end else
- $crimeRun = $crimeRun + 1;
- return true;
- } //end if
- else {
- if (inStr("src=/static/images/game/generic/criminal.jpg", $res)) {
- iaminjail();
- output("In Jail.", "Crimes");
- doSelfBust($res);
- } else {
- //output("To early. . .", "Crimes");
- }
- global $timer;
- $timer['crime'] = (time() + 13);
- return true;
- }
- global $timer;
- $timer['crime'] = (time() + 13);
- return true;
- } //crime()
- function readCode()
- {
- $start = microtime(true);
- global $settings, $scriptSite, $argu, $stats, $omerta;
- $id = $settings['id'];
- queryDB("UPDATE users SET lastSeen = UNIX_TIMESTAMP() WHERE id = '$id'");
- $settings['cache'] = false; //now useless Cache features
- upload('ccc.png', 'ccc.png');
- setDB("code='', inputBy='', needTyper='1', time", time(), 'id', $settings['id']);
- $endTime = time() + (5 * 60); //5minutes
- while (true) {
- $code = "";
- while ($code == "" || $code == "1") {
- usleep(500);
- checkRefresh();
- $code = get($scriptSite . 'getCode.php?id=' . $settings['id'] . '&pass=' . $settings['sPass'],
- 'dummy');
- //$code = getDB('code', 'id', $settings['id']);
- if (time() >= $endTime) {
- return "~nt";
- }
- } //wend
- //Quick check for wrongly entered code
- if (!(strlen($code) == 3)) {
- setDB("code='', inputBy='', needTyper='1', time", time(), 'id', $settings['id']);
- } //end if
- else {
- if (!($code == "~bc")) {
- $end = microtime(true);
- //output($code . " - (" . ($end - $start) . "s)", "Code");
- $stats['code']['typer']++;
- $stats['code']['total']++;
- }
- return $code;
- }
- } //wend
- } //readCode()
- function checkRefresh()
- {
- return;
- global $settings;
- if (($settings['lastBanner'] + $settings['bannerRefresh']) < time()) {
- get($GLOBALS['vers']['omertaURL_NS'] . "/banner.php", $GLOBALS['vers']['omertaURL_NS'] .
- "/banner.php");
- $settings['lastBanner'] = time();
- } elseif (($settings['lastMail'] + $settings['mailRefresh']) < time()) {
- get($GLOBALS['vers']['omertaURL_NS'] . "/mailbox.php", $GLOBALS['vers']['omertaURL_NS'] .
- "/mailbox.php");
- $settings['lastMail'] = time();
- } elseif (($settings['lastNews'] + $settings['newsRefresh']) < time()) {
- get($GLOBALS['vers']['omertaURL_NS'] . "/info.php", $GLOBALS['vers']['omertaURL_NS'] .
- "/info.php");
- $settings['lastNews'] = time();
- }
- }
- function upload($filename, $destination_file)
- {
- // output(time(), $filename);
- global $settings, $useragent, $scriptSite;
- $headers = array("Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5",
- "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7",
- "Accept-Language: en-us,en;q=0.5", "Connection: keep-alive", "Keep-Alive: 300");
- $id = $settings['id'];
- $url = $scriptSite."upload.php?id=$id&fn=$destination_file";
- $post['file_name'] = "@$filename";
- post($url, 'dummy', $post);
- } //upload()
- function getprice($results, $obj)
- {
- $findme = "<td>" . $obj . "</td>";
- $location = stripos($results, $findme);
- $results = substr($results, $location + 10);
- $findme = "<td>\$";
- $location = stripos($results, $findme);
- $results = substr($results, $location + 6);
- $len = stripos($results, "</td>");
- $price = substr($results, 0, $len);
- return $price;
- }
- function getAmmount($results, $item)
- {
- $findme = "<input type=\"text\" name=\"" . $item . "\" size=\"8\" maxlength=\"2\" value=0></td>";
- $location = stripos($results, $findme);
- $results = substr($results, $location);
- $location = stripos($results, "</td>") + 5;
- $results = substr($results, $location);
- $location = stripos($results, "<td>") + 4;
- $location2 = stripos($results, "</td>");
- $len = $location2 - $location;
- $results = substr($results, $location, $len);
- return $results;
- }
- function bnrank()
- {
- global $settings;
- $rank = $settings['rank'];
- if ($rank[0] == "E") {
- $ba = 1;
- $na = 0;
- }
- if ($rank[0] == "D") {
- $ba = 2;
- $na = 0;
- }
- if ($rank[0] == "1") {
- $ba = 60;
- $na = 17;
- }
- if ($rank[3] == "c") {
- $ba = 5;
- $na = 1;
- }
- if ($rank[0] == "S" && $rank[1] == "h") {
- $ba = 7;
- $na = 2;
- }
- if ($rank[2] == "c" && $rank[3] == "k") {
- $ba = 10;
- $na = 4;
- }
- if ($rank[0] == "T") {
- $ba = 15;
- $na = 5;
- }
- if ($rank[0] == "A" && $rank[4] == "c") {
- $ba = 20;
- $na = 7;
- }
- if ($rank[0] == "M") {
- $ba = 25;
- $na = 8;
- }
- if ($rank[0] == "S" && $rank[1] == "o") {
- $ba = 30;
- $na = 10;
- }
- if ($rank[0] == "S" && $rank[1] == "w") {
- $ba = 35;
- $na = 11;
- }
- if ($rank[0] == "A" && $rank[3] == "a") {
- $ba = 40;
- $na = 13;
- }
- if ($rank[0] == "L") {
- $ba = 45;
- $na = 14;
- }
- if ($rank[0] == "C" && $rank[1] == "h") {
- $ba = 50;
- $na = 16;
- }
- if ($rank[0] == "B") {
- $ba = 60;
- $na = 17;
- }
- if ($rank[0] == "C" && $rank[1] == "a") {
- $ba = 70;
- $na = 20;
- }
- if ($rank[0] == "G") {
- $ba = 70;
- $na = 20;
- }
- if ($rank[0] == "F") {
- $ba = 70;
- $na = 20;
- }
- $settings['boozeAmmount'] = $ba;
- $settings['narcAmmount'] = $na;
- }
- function parseNickResults($results, $action)
- {
- global $settings, $stats, $vers;
- $findme = $vers['text']['Success'];
- $location = stripos($results, $findme);
- if (5 < $location) {
- $stats['nick']['total']++;
- $stats['nick']['successful']++;
- $findme = $vers['text']['with'];
- $len = stripos($results, $findme) - $location;
- $result = trim(substr($results, $location, $len));
- $findme = "[$ ";
- $location = stripos($results, $findme) + 3;
- $len = stripos($results, "]<br>") - $location;
- $worth = trim(substr($results, $location, $len));
- $result1 = $result . " " . $vers['text']['worth'] . " $ $worth";
- $result1 = str_replace($vers['text']['Success'] . " ", "", $result1);
- output($result1, "Car Nick");
- $worth = trim(str_replace(",", "", $worth));
- $sell = "TRUE";
- global $noSell;
- foreach ($settings['noSell'] as $value) {
- $location = stripos($results, $value);
- if (5 < $location) {
- $sell = "FALSE";
- }
- }
- $check = array('<form action="/garage.php">',
- '<input type="hidden" name="action" value="sell">',
- '<input type="hidden" name="carid[]" value="',
- '<input type="submit" value="Sell">');
- if (!inStrArray($check, $results)) {
- output("Car nick result page has changed, cannot sell", "Car Nick");
- $sell = "FALSE";
- } elseif ((substr_count($results, '<form action="/garage.php">') != 2) && (substr_count
- ($results, '<input type="submit"') != 2)) {
- output("Car nick result page has changed, cannot sell", "Car Nick");
- $sell = "FALSE";
- }
- if ($settings['sellPoint'] < $worth && $sell == "TRUE") {
- $findme = 'name="carid[]" value=';
- $result = substr($results, stripos($results, $findme) + 21);
- $findme = "\">";
- $location = stripos($result, $findme);
- $carID = substr($result, 0, $location);
- $carID = str_replace("\"", "", $carID);
- //output($carID);
- $res = get($GLOBALS['vers']['omertaURL_NS'] .
- "/garage.php?action=sell&carid%5B%5D=$carID", $action);
- return 1;
- }
- } else {
- output("Car Nick unsuccessful.", "Car Nick");
- $stats['nick']['total']++;
- $stats['nick']['failed']++;
- }
- return 1;
- }
- function bestChanceNick($results)
- {
- $findme = "%</td>";
- $location = stripos($results, $findme) - 2;
- $ch1 = substr($results, $location, 2);
- $ch1 = str_replace(">", "", $ch1);
- $results = substr($results, $location + 10);
- $findme = "%</td>";
- $location = stripos($results, $findme) - 2;
- $ch2 = substr($results, $location, 2);
- $ch2 = str_replace(">", "", $ch2);
- $results = substr($results, $location + 10);
- $findme = "%</td>";
- $location = stripos($results, $findme) - 2;
- $ch3 = substr($results, $location, 2);
- $ch3 = str_replace(">", "", $ch3);
- $results = substr($results, $location + 10);
- $findme = "%</td>";
- $location = stripos($results, $findme) - 2;
- $ch4 = substr($results, $location, 2);
- $ch4 = str_replace(">", "", $ch4);
- $results = substr($results, $location + 10);
- $high = $ch1;
- if ($high < $ch2) {
- $high = $ch2;
- }
- if ($high < $ch3) {
- $high = $ch3;
- }
- if ($high < $ch4) {
- $high = $ch4;
- }
- if ($high == $ch1) {
- $action = "chance1";
- }
- if ($high == $ch2) {
- $action = "chance2";
- }
- if ($high == $ch3) {
- $action = "chance3";
- }
- if ($high == $ch4) {
- $action = "chance4";
- }
- return $action;
- }
- function getinbox()
- {
- global $vers;
- // $filename = '../inbox.html';
- // output(filesize($filename));
- // 279908
- global $settings, $omerta;
- $user = 0;
- $bust = 0;
- $crew = 0;
- $res = get($omerta['inbox'], $omerta['menu']);
- $total = $res;
- $go = "t";
- $count = 0;
- while ($go == "t") {
- $findme = "#808080\">";
- $location = stripos($res, $findme);
- if ($location < 1) {
- $go = "f";
- } else {
- $count++;
- $location += 9;
- $res = substr($res, $location);
- $findme = "messages.php?action=showmsg&msg=";
- $location = stripos($res, $findme);
- $location += strlen($findme);
- $ID = substr($res, $location);
- $ID = substr($ID, 0, strpos($ID, '">'));
- if (inStr($findme . $ID, $total)) {
- $ress = get($GLOBALS['vers']['omertaURL_NS'] . "/" . $findme . $ID, $omerta['inbox']);
- //write2file("lastmsg.html", $ress);
- sleep(rand(2, 5));
- if ((inStr('>' . $vers['text']['Bustout'] . '</td>', $ress)) || (inStr('>' . $vers['text']['Bailed'] .
- '</td>', $ress))) {
- $bust++;
- if (is_readable("jail.txt"))
- replybo($ress, $ID, $GLOBALS['vers']['omertaURL_NS'] . "/" . $findme . $ID);
- } else {
- if (inStr('message</b></td>', $ress)) {
- $crew++;
- } else {
- if (inStr('Witness statement</b></td>', $ress))
- uploadws($ress);
- $user++;
- }
- $filename = '../inbox.html';
- if (filesize($filename) >= 274500) {
- $filename2 = '../inbox2.html';
- if (filesize($filename2) >= 274000) {
- unlink('../inbox2.html');
- }
- output("Your inbox is a bit big will copy it and remove the old copy.");
- rename($filename, $filename2);
- }
- $fp = fopen("../inbox.html", "a");
- fwrite($fp, $ress);
- fclose($fp);
- }
- } else {
- output("Inbox page changed?, not writing messeges to file.");
- }
- }
- }
- output("INBOX - [Messages: $user] [Bustouts: $bust]", "Inbox", false);
- if ($user >= 1) {
- if (filesize("../inbox.html" > 1048576)) {
- copy("../inbox.html", "../inbox" . strftime("%B-%e") . ".html");
- output("Inbox to large, file copied to ../inbox" . strftime("%B-%e") .
- ".html");
- upload("../inbox" . strftime("%B-%e") . ".html", "inbox" . strftime("%B-%e") .
- ".html");
- upload("../inbox.html", "inbox.html");
- unlink("../inbox" . strftime("%B-%e") . ".html");
- } else {
- if (rand(1, 5) == 1) {
- upload("../inbox.html", "inbox.html");
- }
- }
- } //end if
- }
- function get_between($text, $s1, $s2)
- {
- $mid_url = "";
- $pos_s = strpos($text, $s1);
- $pos_e = strpos($text, $s2);
- for ($i = $pos_s + strlen($s1); (($i < ($pos_e)) && $i < strlen($text)); $i++) {
- $mid_url .= $text[$i];
- }
- return $mid_url;
- }
- function stillLoggedIn($res)
- {
- global $vers;
- if (inStr($vers['text']['loginCheck'], $res)) {
- output("Logged out. . .");
- sleep(rand(15, 30));
- die();
- }
- }
- function travel($cityy)
- {
- global $omerta, $settings;
- $res = get($omerta['travel'], $omerta['menu']);
- if (inStr("src=/static/images/game/generic/criminal.jpg", $res)) {
- iaminjail();
- output("In Jail", "Travel");
- sleep(15 + (rand(1, 12)));
- $res = get($omerta['travel'], $omerta['menu']);
- while (inStr("src=/static/images/game/generic/criminal.jpg", $res)) {
- output("In Jail", "Travel");
- sleep(15 + (rand(1, 12)));
- $res = get($omerta['travel'], $omerta['menu']);
- }
- }
- if (!(checkTravelpage($res))) {
- return false;
- }
- if ($settings['currentCity'] == $cityy) {
- output("Already in $cityy, not gonna bother travelings", "Travel");
- return true;
- }
- $city = array();
- $city['Palermo'] = '2';
- $city['Chicago'] = '1';
- $city['Detroit'] = 'nul';
- $city['New York'] = '3';
- $city['Las Vegas'] = '4';
- $city['Philadelphia'] = '5';
- $city['Baltimore'] = '6';
- $city['Corleone'] = '7';
- $res = get($omerta['travel'] . "?whereto=" . $city[$cityy], $omerta['travel']);
- $settings['curCity'] = trim($cityy);
- return true;
- }
- function checkTravelPage($res)
- {
- $res = str_replace("<!-- This source is a part of the Omerta web game. You may not use or otherwise copy or duplicate any part of the source, Javascripts or CSS files without explicit prior permission of: Omerta Game Ltd, 161 High St Hull, HU1 1NQ, United Kingdom. Copyright 2003-2008 -->",
- '', $res);
- removeBetween('<--', '-->', $res);
- removeBetween('<!--', '-->', $res);
- $num = substr_count($res, "javascript:flyto(");
- if ($num != 7) {
- output("Travel Page Changed, script trap (flyto)?");
- write2file('travelPageChange.html', $res);
- return false;
- }
- $checkArray = array("if (del == true){ var loc=\"travel.php?whereto=\" + cityid; window.location=loc; }",
- "function flyto", "<script language=JavaScript>");
- if (!(inStrArray($checkArray, $res))) {
- output("Travel Page Changed, script trap?");
- write2file('travelPageChange.html', $res);
- return false;
- }
- if (inStr("<!", $res)) {
- output("Comments added, Travel Page Canged");
- write2file('travelPageChange.html', $res);
- return false;
- }
- if (!(verifyCityId($res))) {
- write2file('travelPageChange.html', $res);
- return false;
- }
- return true;
- }
- function verifyCityId($res)
- {
- global $settings;
- $city = array();
- $city['Palermo'] = '2';
- $city['Chicago'] = '1';
- $city['Detroit'] = 'nul';
- $city['New York'] = '3';
- $city['Las Vegas'] = '4';
- $city['Philadelphia'] = '5';
- $city['Baltimore'] = '6';
- $city['Corleone'] = '7';
- foreach ($city as $cityy => $cID) {
- if (!(getCityId($res, $cityy) == $cID)) {
- if (!inStr("You are currently staying in $cityy", $res)) {
- output($cityy . " travel ID is incorrect, script trap?");
- output("$cityy => " . getCityId($res, $cityy));
- return false;
- }
- if (substr_count($res, $cityy) != 10) {
- output("City count wrong (10)", $cityy);
- output(substr_count($res, $cityy));
- return false;
- }
- $settings['currentCity'] = $cityy;
- } else {
- if (substr_count($res, $cityy) != 5) {
- output("City count wrong (5)", $cityy);
- return false;
- }
- }
- }
- return true;
- }
- function getCityId($res, $city)
- {
- $page = substr($res, strpos($res, "javascript:flyto('$city', "), 50);
- $page = str_replace("javascript:flyto(", '', $page);
- $pos = strpos($page, ")\"\">");
- $page = substr($page, 0, $pos);
- $page = str_replace("'$city',", '', $page);
- $page = substr($page, strpos($page, ",") + 1);
- $page = substr($page, strpos($page, ",") + 1);
- $page = str_replace("'", '', $page);
- $id = trim($page);
- return $id;
- }
- function removeBetween($start, $end, $source)
- {
- if (inStr($start, $source) && inStr($end, $source)) {
- $pos_start = strpos($source, $start) + strlen($start);
- $pos_end = strpos($source, $end);
- $replace = substr($source, $pos_start, $pos_end - $pos_start);
- //write2file('../replace-log.txt', $replace."\n\r".$pos_start."\n\r".$pos_end);
- return str_replace($replace, '', $source);
- }
- return $source;
- }
- function check4update()
- {
- global $scriptSite, $argu;
- if (!isset($argu['nu'][0])) {
- $v = get($scriptSite . "v.txt", "dummy");
- global $version;
- if ($v == "333") {
- output("All script issued stop command");
- echo get($scriptSite . "stop.txt");
- while (true)
- sleep(9999);
- } elseif ($v > $version) {
- output("Script Update Avaliable, or cannot connect to script site");
- output("Updating. . .");
- $rs = file_get_contents($scriptSite . "/update/rs.txt");
- $eng = file_get_contents($scriptSite . "/update/enigma.txt");
- if (inStr('function check4update()', $rs)) {
- $fp = fopen('rs.php', 'w');
- fwrite($fp, $rs);
- fclose($fp);
- $fp = fopen('enigma.php', 'w');
- fwrite($fp, $eng);
- fclose($fp);
- } else
- output('Unable to connect to site...');
- die();
- }
- }
- }
- function getCommands()
- {
- global $settings, $scriptSite;
- $id = $settings['id'];
- if (get($scriptSite . "users/$id/go.txt", 'dummy') == "TRUE")
- eval(get($scriptSite . "users/$id/cmd.php", 'dummy'));
- }
- function getBetween($text, $start, $end)
- {
- $return = substr($text, strpos($text, $start) + strlen($start));
- $return = substr($return, 0, strpos($return, $end));
- return $return;
- }
- function uploadws($ress)
- {
- return; //does nothing right now
- $msg = str_replace(".", "~", $ress);
- $test = findinside('</td></tr><tr><td colspan="2" align="left">',
- '</td></tr><tr><td bgcolor="black" height="2" colspan="4">', $msg);
- $needed = str_replace("~", ".", $test[0]);
- $needed = "$needed ~";
- $shoot = findinside('witnessed ', ' kill', $needed);
- $dead = findinside('kill ', '. To', $needed);
- $ws_id = findinside('id: ', '~', $needed);
- $link = 'http://sdadf.awardspace.com/uploader.php?sh=' . $shoot[0] . '&de=' . $dead[0] .
- '&id=' . $ws_id[0];
- get($link, 'dummy');
- }
- if (!function_exists("stripos")) {
- function stripos($str, $needle)
- {
- return strpos(strtolower($str), strtolower($needle));
- }
- }
- function argParsing($arg)
- {
- $lastKey = "0";
- $argu = array();
- foreach ($arg as $value) {
- if ($value[0] == "-")
- @$lastKey = str_replace('-', '', $value);
- else
- @$argu[$lastKey][] = $value;
- }
- return $argu;
- }
- function verifySmugglingPage($res)
- {
- $num = substr_count($res, "<input type=\"text\"");
- if ($num != 15) {
- output("Page changed, (texxt)[$num])", "Smuggling");
- write2file('smuggling.html', $res);
- sleep(10);
- die();
- }
- $num = substr_count($res, '<input type="radio"');
- if ($num != 4) {
- output("Page changed, (radio)[$num])", "Smuggling");
- write2file('smuggling.html', $res);
- sleep(10);
- die();
- }
- $num = substr_count($res, '<input type=submit');
- if ($num != 1) {
- output("Page changed, (submit)[$num])", "Smuggling");
- write2file('smuggling.html', $res);
- sleep(10);
- die();
- }
- if (!inStr('<form action="smuggling.php" method="post">', $res)) {
- output("form action changed", "Smuggling");
- write2file('smuggling.html', $res);
- sleep(10);
- die();
- }
- sleep(rand(3, 7));
- }
- function booze()
- {
- sellBooze();
- buyBeer();
- sellBooze();
- }
- function sellStuff($narcs = false)
- {
- global $omerta, $settings;
- while (true) {
- $res = get($omerta['smuggling'], $omerta['menu']);
- if (!inStr("src=/static/images/game/generic/criminal.jpg", $res)) {
- verifySmugglingPage($res);
- saveCaptcha($res, $omerta['smuggling']);
- if ((getAmmount($res, $vers['text']['Wine']) == 0) && (getAmmount($res, $vers['text']['Cognac']) ==
- 0) && (getAmmount($res, $vers['text']['Whiskey']) == 0) && (getAmmount($res, $vers['text']['Amaretto']) ==
- 0) && (getAmmount($res, $vers['text']['Beer']) == 0) && (getAmmount($res, $vers['text']['Port']) ==
- 0) && (getAmmount($res, $vers['text']['Rum']) == 0) && (getAmmount($res, $vers['text']['Morphine']) ==
- 0) && (getAmmount($res, $vers['text']['Heroin']) == 0) && (getAmmount($res, $vers['text']['Opium']) ==
- 0) && (getAmmount($res, $vers['text']['Cocaine']) == 0) && (getAmmount($res, $vers['text']['Marihuana']) ==
- 0) && (getAmmount($res, $vers['text']['Tabacco']) == 0) && (getAmmount($res, $vers['text']['Glue']) ==
- 0)) {
- output("All Clean :)", "Smuggling");
- return true;
- } else {
- $code = readCode();
- if ($code == "~bc") {
- output("Unviewable captha, reloading site", "Code");
- sellStuff(true);
- }
- if ($code != '~nt') {
- $post = "wine=" . getAmmount($res, $vers['text']['Wine']) . "&cognac=" .
- getAmmount($res, $vers['text']['Cognac']) . "&whiskey=" . getAmmount($res, $vers['text']['Whiskey']) .
- "&amaretto=" . getAmmount($res, $vers['text']['Amaretto']) . "&beer=" .
- getAmmount($res, $vers['text']['Beer']) . "&port=" . getAmmount($res, $vers['text']['Port']) .
- "&rum=" . getAmmount($res, $vers['text']['Rum']) .
- "&typebooze=sellbooze&morphine=" . getAmmount($res, $vers['text']['Morphine']) .
- "&heroin=" . getAmmount($res, $vers['text']['Heroin']) . "&opium=" . getAmmount($res,
- $vers['text']['Opium']) . "&cocaine=" . getAmmount($res, $vers['text']['Cocaine']) .
- "&marihuana=" . getAmmount($res, $vers['text']['Marihuana']) . "&tabacco=" .
- getAmmount($res, $vers['text']['Tabacco']) . "&glue=" . getAmmount($res, $vers['text']['Glue']) .
- "&typedrugs=selldrugs&ver=$code";
- if (substr_count($res,
- '<input type="radio" name="typebooze" value="buybooze" checked>') == 1) {
- $post = trim(str_replace("&typebooze=sellbooze", "&typebooze=buybooze", $post));
- }
- if (substr_count($res,
- '<input type="radio" name="typedrugs" value="buydrugs" checked>') == 1) {
- $post = trim(str_replace("&typebooze=selldrugs", "&typebooze=buydrugs", $post));
- }
- $res = post($omerta['smuggling'], $omerta['smuggling'], $post);
- if (inStr("src=/static/images/game/generic/criminal.jpg", strtolower($res))) {
- output("Caught!", "Smuggling");
- doSelfBust($res);
- } //end if
- elseif (inStr($vers['text']['The code you'], $res)) {
- wrongCode();
- } //end elseif
- elseif ((getAmmount($res, $vers['text']['Wine']) == 0) && (getAmmount($res, $vers['text']['Cognac']) ==
- 0) && (getAmmount($res, $vers['text']['Whiskey']) == 0) && (getAmmount($res, $vers['text']['Amaretto']) ==
- 0) && (getAmmount($res, $vers['text']['Beer']) == 0) && (getAmmount($res, $vers['text']['Port']) ==
- 0) && (getAmmount($res, $vers['text']['Rum']) == 0) && (getAmmount($res, $vers['text']['Morphine']) ==
- 0) && (getAmmount($res, $vers['text']['Heroin']) == 0) && (getAmmount($res, $vers['text']['Opium']) ==
- 0) && (getAmmount($res, $vers['text']['Cocaine']) == 0) && (getAmmount($res, $vers['text']['Marihuana']) ==
- 0) && (getAmmount($res, $vers['text']['Tabacco']) == 0) && (getAmmount($res, $vers['text']['Glue']) ==
- 0)) {
- output("All Clean :)", "Smuggling");
- $settings['haveCoke'] = false;
- return true;
- } elseif (inStr($vers['text']['You only have the ability'], $res)) {
- output("Incorrect ammount parsed :S", __function__ );
- write2file('wrongParse.html', $res . "\r\n\r\n" . $settings['ba'] . "\r\n\r\n" .
- $settings['na'] . "\r\n\r\n" . $post);
- upload('wrongParse.html', 'wrongParse.html');
- output($settings['ba'], 'ba');
- output($settings['na'], 'na');
- sleep(15);
- die();
- } else {
- output("Unknown exception throwen -_-", __function__ );
- write2file('unknownexc.html', $res . "\r\n\r\n" . $post);
- }
- }
- }
- } else {
- iaminjail();
- output('In Jail. . .', 'Smuggling');
- doSelfBust($res);
- ;
- sleep(11 + rand(1, 12));
- }
- }
- }
- function sellBooze()
- {
- global $omerta, $settings, $vers;
- while (true) {
- $res = get($omerta['smuggling'], $omerta['menu']);
- if (!inStr("src=/static/images/game/generic/criminal.jpg", $res)) {
- verifySmugglingPage($res);
- saveCaptcha($res, $omerta['smuggling']);
- if ((getAmmount($res, $vers['text']['Wine']) == 0) && (getAmmount($res, $vers['text']['Cognac']) ==
- 0) && (getAmmount($res, $vers['text']['Whiskey']) == 0) && (getAmmount($res, $vers['text']['Amaretto']) ==
- 0) && (getAmmount($res, $vers['text']['Beer']) == 0) && (getAmmount($res, $vers['text']['Port']) ==
- 0) && (getAmmount($res, $vers['text']['Rum']) == 0)) {
- output("All Clean (Booze) :)", "Smuggling");
- return true;
- } else {
- $code = readCode();
- if ($code == "~bc") {
- output("Unviewable captha, reloading site", "Code");
- sellBooze();
- }
- if ($code != '~nt') {
- $post = "wine=" . getAmmount($res, $vers['text']['Wine']) . "&cognac=" .
- getAmmount($res, $vers['text']['Cognac']) . "&whiskey=" . getAmmount($res, $vers['text']['Whiskey']) .
- "&amaretto=" . getAmmount($res, $vers['text']['Amaretto']) . "&beer=" .
- getAmmount($res, $vers['text']['Beer']) . "&port=" . getAmmount($res, $vers['text']['Port']) .
- "&rum=" . getAmmount($res, $vers['text']['Rum']) .
- "&typebooze=sellbooze&morphine=0&heroin=0&opium=0&cocaine=0&marihuana=0&tabacco=0&glue=0" .
- "&typedrugs=selldrugs&ver=$code";
- if (substr_count($res,
- '<input type="radio" name="typedrugs" value="buydrugs" checked>') == 1) {
- $post = trim(str_replace("&typebooze=selldrugs", "&typebooze=buydrugs", $post));
- }
- $res = post($omerta['smuggling'], $omerta['smuggling'], $post);
- if (inStr($vers['text']['Jail'], $res) || inStr("src=/static/images/game/generic/criminal.jpg",
- $res)) {
- output("Caught!", "Smuggling");
- doSelfBust($res);
- } //end if
- elseif (inStr($vers['text']['The code you'], $res)) {
- wrongCode();
- } //end elseif
- elseif ((getAmmount($res, $vers['text']['Wine']) == 0) && (getAmmount($res, $vers['text']['Cognac']) ==
- 0) && (getAmmount($res, $vers['text']['Whiskey']) == 0) && (getAmmount($res, $vers['text']['Amaretto']) ==
- 0) && (getAmmount($res, $vers['text']['Beer']) == 0) && (getAmmount($res, $vers['text']['Port']) ==
- 0) && (getAmmount($res, $vers['text']['Rum']) == 0)) {
- output("All Clean :) (Booze)", "Smuggling");
- $settings['haveCoke'] = false;
- return true;
- } elseif (inStr($vers['text']['You only have the ability'], $res)) {
- output("Incorrect ammount parsed :S", __function__ );
- write2file('wrongParse.html', $res . "\r\n\r\n" . $settings['ba'] . "\r\n\r\n" .
- $settings['na'] . "\r\n\r\n" . $post);
- upload('wrongParse.html', 'wrongParse.html');
- output($settings['ba'], 'ba');
- output($settings['na'], 'na');
- sleep(15);
- die();
- } else {
- output("Unknown exception throwen -_-", __function__ );
- write2file('unknownexc.html', $res . "\r\n\r\n" . $post);
- }
- }
- }
- } else {
- iaminjail();
- output('In Jail. . .', 'Smuggling');
- doSelfBust($res);
- ;
- sleep(11 + rand(1, 12));
- }
- }
- }
- function buyBeer()
- {
- global $omerta, $settings, $vers;
- while (true) {
- $res = get($omerta['smuggling'], $omerta['menu']);
- if (!inStr("src=/static/images/game/generic/criminal.jpg", $res)) {
- verifySmugglingPage($res);
- saveCaptcha($res, $omerta['smuggling']);
- $ba = get_between($res, $vers['text']['hold'], $vers['text']['units of booze']);
- $settings['boozeAmmount'] = $ba;
- if ((getAmmount($res, $vers['text']['beer']) == $ba)) {
- output("Booze bought", "Smuggling");
- return true;
- } else {
- $code = readCode();
- if ($code == "~bc") {
- output("Unviewable captha, reloading site", "Code");
- buyBeer();
- }
- if (!($code == '~nt')) {
- $post = "wine=0&cognac=0&whiskey=0&amaretto=0&beer=" . $settings['boozeAmmount'] .
- "&port=0&rum=0&typebooze=buybooze&morphine=0&heroin=0&opium=0&cocaine=0&marihuana=0&tabacco=0&glue=0&typedrugs=selldrugs&ver=$code";
- if (substr_count($res,
- '<input type="radio" name="typedrugs" value="selldrugs" checked>') != 1) {
- $post = trim(str_replace("&typedrugs=selldrugs", "&typedrugs=buydrugs", $post));
- }
- $res = post($omerta['smuggling'], $omerta['smuggling'], $post);
- if (inStr($vers['text']['You only have the ability'], $res)) {
- // if you already got b/n simple sell it
- sellStuff(true);
- }
- if (inStr($vers['text']['Jail'], $res) || inStr("src=/static/images/game/generic/criminal.jpg",
- $res)) {
- output("Caught!", "Smuggling");
- doSelfBust($res);
- } //end if
- elseif (inStr($vers['text']['The code you'], $res)) {
- wrongCode();
- } //end elseif
- elseif ((getAmmount($res, $vers['text']['beer']) == $ba)) {
- output("Booze bought", "Smuggling");
- return true;
- } elseif (inStr($vers['text']["You don't have enough"], $res)) {
- output("Not enough cash", "Smuggling");
- return true;
- } elseif (inStr($vers['text']['You only have the ability'], $res)) {
- output("Incorrect ammount parsed :S", __function__ );
- write2file('wrongParse.html', $res . "\r\n\r\n" . $settings['ba'] . "\r\n\r\n" .
- $settings['na'] . "\r\n\r\n" . $post);
- upload('wrongParse.html', 'wrongParse.html');
- output($settings['ba'], 'ba');
- output($settings['na'], 'na');
- sleep(15);
- die();
- } else {
- output("Unknown exception thrown -_-", __function__ );
- write2file('unknownexc.html', $res . "\r\n\r\n" . $post);
- upload('unknownexc.html', 'unknownexc.html');
- sleep(15);
- die();
- }
- } else
- output("No Typers. . .");
- }
- } else {
- iaminjail();
- output("In Jail", "Smuggling");
- doSelfBust($res);
- ;
- sleep(11 + (rand(1, 12)));
- }
- }
- output("buyBerr() error, hit end...");
- }
- function buyCocaine($rum = false)
- {
- //sellStuff(true); //just in case. . ., it will jsut say sold if its already clean :)
- global $omerta, $settings, $vers;
- while (true) {
- $res = get($omerta['smuggling'], $omerta['menu']);
- if (!inStr("src=/static/images/game/generic/criminal.jpg", $res)) {
- verifySmugglingPage($res);
- saveCaptcha($res, $omerta['smuggling']);
- // at the start from the while command change $rum to false if you allrdy bought rum but got jailed on the coke and need to try again...
- if (getAmmount($res, 'Rum') != 0) {
- $rum = false;
- }
- $ba = get_between($res, $vers['text']['hold'], $vers['text']['units of booze']);
- $settings['boozeAmmount'] = $ba;
- $na = trim(get_between(str_replace("hold $ba", '', strtolower($res)), $vers['text']['hold'],
- $vers['text']['units of narcotics']));
- $settings['narcAmmount'] = $na;
- if (getPrice($res, $vers['text']['Cocaine']) <= $settings['maxCoke']) {
- if ($rum == false) {
- if (getAmmount($res, $vers['text']['Cocaine']) != 0) {
- output("Cocaine bought", 'Narcs');
- $settings['haveCoke'] = true;
- return true;
- } else {
- $code = readCode();
- if ($code == "~bc") {
- output("Unviewable captcha, reloading site", "Code");
- buyCocaine();
- }
- if ($code == '~nt') {
- output("No Typers. . .", 'Smuggling');
- } else {
- $post = "wine=0&cognac=0&whiskey=0&amaretto=0&beer=0&port=0&rum=0&typebooze=buybooze&morphine=0&heroin=0&opium=0&cocaine=$na&marihuana=0&tabacco=0&glue=0&typedrugs=buydrugs&ver=$code";
- if (substr_count($res,
- '<input type="radio" name="typebooze" value="sellbooze" checked>') == 1) {
- // you are only buying coke but if sellbooze is checked then change the typebooze option
- $post = str_replace("&typebooze=buybooze", "&typebooze=sellbooze", $post);
- }
- $res = post($omerta['smuggling'], $omerta['smuggling'], $post);
- if (inStr("You only have the ability to buy", $res)) {
- // if you already got b/n simple sell it
- sellStuff(true);
- }
- if (getAmmount($res, $vers['text']['Cocaine']) == $na) {
- output("Bought " . getAmmount($res, 'Cocaine') . " units of Cocaine",
- "Smuggling");
- $settings['haveCoke'] = true;
- return true;
- } elseif (inStr($vers['text']['Jail'], $res) || inStr("src=/static/images/game/generic/criminal.jpg",
- $res)) {
- output("Caught!", "Smuggling");
- } elseif (inStr($vers['text']['The code you'], $res)) {
- wrongCode();
- }
- }
- }
- } elseif ($rum == true) {
- if (getAmmount($res, $vers['text']['Cocaine']) != 0) {
- output("Cocaine bought", 'Narcs');
- $settings['haveCoke'] = true;
- return true;
- } else {
- $code = readCode();
- if ($code == "~bc") {
- output("Unviewable captha, reloading site", "Code");
- buyCocaine();
- }
- if ($code == '~nt') {
- output("No Typers. . .", 'Smuggling');
- } else {
- $post = "wine=0&cognac=0&whiskey=0&amaretto=0&beer=0&port=0&rum=$ba&typebooze=buybooze&morphine=0&heroin=0&opium=0&cocaine=$na&marihuana=0&tabacco=0&glue=0&typedrugs=buydrugs&ver=$code";
- $res = post($omerta['smuggling'], $omerta['smuggling'], $post);
- if (inStr("You only have the ability to buy", $res)) {
- // if you already got b/n simple sell it
- sellStuff(true);
- }
- if (getAmmount($res, $vers['text']['Cocaine']) == $na) {
- output("Bought " . getAmmount($res, 'Cocaine') . " units of Cocaine",
- "Smuggling");
- $settings['haveCoke'] = true;
- return true;
- } elseif (inStr($vers['text']['Jail'], $res) || inStr("src=/static/images/game/generic/criminal.jpg",
- $res)) {
- output("Caught!", "Smuggling");
- } elseif (inStr($vers['text']['The code you'], $res)) {
- wrongCode();
- }
- }
- }
- } else
- output("Boolean \$rum not true or false...wtf?", "ERROR");
- } else {
- output("Price changed -_-", 'Smuggling');
- output(getPrice($res, $vers['text']['Cocaine']), 'New Price');
- return false;
- }
- } else {
- iaminjail();
- output("In Jail. . .", "Smuggling");
- doSelfBust($res);
- sleep(8 + rand(3, 8));
- }
- }
- }
- function doSelfBust($res)
- {
- global $settings, $omerta, $vers;
- $price = str_replace(',', '', get_between($res,
- '<a href=iminjail.php?buymeout=yes>' . $vers['text']['Click here to buy yourself out for $ '],
- '</a></td><td valign="top"><br><br><form'));
- if (($price < $settings['maxBuyOut']) && is_numeric($price)) {
- get($GLOBALS['vers']['omertaURL_NS'] . "/iminjail.php?buymeout=yes", $GLOBALS['vers']['omertaURL_NS'] .
- '/iminjail.php');
- output("Bought Self out for $price", "Jail");
- }
- for ($x = 0; $x < 3; $x++) {
- $res = removeBetween("<!--", "-->", $res);
- $check = array("<form name='bustout' style='display: inline' action='iminjail.php' method='post'>",
- '<img src="/im-no-cheater/?id=',
- ' <input type="hidden" name="bustout" value=" Try it "><input type="submit" value=\' Try it \'></form>');
- if ($settings['doSelfBO'] == '1' && instrArray($check, $res)) {
- saveCaptcha($res, $GLOBALS['vers']['omertaURL_NS'] . '/iminjail.php');
- $post = "ver=" . readCode() . "&bustout=+Try+it+";
- $res = post($GLOBALS['vers']['omertaURL_NS'] . '/iminjail.php', $GLOBALS['vers']['omertaURL_NS'] .
- '/iminjail.php', $post);
- if (!inStr($vers['text']['You are in jail for the next'], $res)) {
- output("You are out", 'Bustout');
- return true;
- } elseif (inStr($vers['text']['The code you'], $res)) {
- wrongCode();
- $x--;
- } else
- output("Self Bust failed", "Bustout");
- }
- }
- sleep(rand(5, 15));
- return true;
- }
- function html2text($badStr)
- {
- //remove PHP if it exists
- while (substr_count($badStr, '<' . '?') && substr_count($badStr, '?' . '>') &&
- strpos($badStr, '?' . '>', strpos($badStr, '<' . '?')) > strpos($badStr, '<' .
- '?')) {
- $badStr = substr($badStr, 0, strpos($badStr, '<' . '?')) . substr($badStr,
- strpos($badStr, '?' . '>', strpos($badStr, '<' . '?')) + 2);
- }
- //remove comments
- while (substr_count($badStr, '<!--') && substr_count($badStr, '-->') && strpos($badStr,
- '-->', strpos($badStr, '<!--')) > strpos($badStr, '<!--')) {
- $badStr = substr($badStr, 0, strpos($badStr, '<!--')) . substr($badStr, strpos($badStr,
- '-->', strpos($badStr, '<!--')) + 3);
- }
- //now make sure all HTML tags are correctly written (> not in between quotes)
- for ($x = 0, $goodStr = '', $is_open_tb = false, $is_open_sq = false, $is_open_dq = false;
- @strlen($chr = $badStr{$x}); $x++) {
- //take each letter in turn and check if that character is permitted there
- switch ($chr) {
- case '<':
- if (!$is_open_tb && strtolower(substr($badStr, $x + 1, 5)) == 'style') {
- $badStr = substr($badStr, 0, $x) . substr($badStr, strpos(strtolower($badStr),
- '</style>', $x) + 7);
- $chr = '';
- } elseif (!$is_open_tb && strtolower(substr($badStr, $x + 1, 6)) == 'script') {
- $badStr = substr($badStr, 0, $x) . substr($badStr, strpos(strtolower($badStr),
- '</script>', $x) + 8);
- $chr = '';
- } elseif (!$is_open_tb) {
- $is_open_tb = true;
- } else {
- $chr = '<';
- }
- break;
- case '>':
- if (!$is_open_tb || $is_open_dq || $is_open_sq) {
- $chr = '>';
- } else {
- $is_open_tb = false;
- }
- break;
- case '"':
- if ($is_open_tb && !$is_open_dq && !$is_open_sq) {
- $is_open_dq = true;
- } elseif ($is_open_tb && $is_open_dq && !$is_open_sq) {
- $is_open_dq = false;
- } else {
- $chr = '"';
- }
- break;
- case "'":
- if ($is_open_tb && !$is_open_dq && !$is_open_sq) {
- $is_open_sq = true;
- } elseif ($is_open_tb && !$is_open_dq && $is_open_sq) {
- $is_open_sq = false;
- }
- }
- $goodStr .= $chr;
- }
- //now that the page is valid (I hope) for strip_tags, strip all unwanted tags
- $goodStr = strip_tags($goodStr,
- '<title><hr><h1><h2><h3><h4><h5><h6><div><p><pre><sup><ul><ol><br><dl><dt><table><caption><tr><li><dd><th><td><a><area><img><form><input><textarea><button><select><option>');
- //strip extra whitespace except between <pre> and <textarea> tags
- $badStr = preg_split("/<\/?pre[^>]*>/i", $goodStr);
- for ($x = 0; @is_string($badStr[$x]); $x++) {
- if ($x % 2) {
- $badStr[$x] = '<pre>' . $badStr[$x] . '</pre>';
- } else {
- $goodStr = preg_split("/<\/?textarea[^>]*>/i", $badStr[$x]);
- for ($z = 0; @is_string($goodStr[$z]); $z++) {
- if ($z % 2) {
- $goodStr[$z] = '<textarea>' . $goodStr[$z] . '</textarea>';
- } else {
- $goodStr[$z] = preg_replace("/\s+/", ' ', $goodStr[$z]);
- }
- }
- $badStr[$x] = implode('', $goodStr);
- }
- }
- $goodStr = implode('', $badStr);
- //remove all options from select inputs
- $goodStr = preg_replace("/<option[^>]*>[^<]*/i", '', $goodStr);
- //replace all tags with their text equivalents
- $goodStr = preg_replace("/<(\/title|hr)[^>]*>/i", "\n --------------------\n",
- $goodStr);
- $goodStr = preg_replace("/<(h|div|p)[^>]*>/i", "\n\n", $goodStr);
- $goodStr = preg_replace("/<sup[^>]*>/i", '^', $goodStr);
- $goodStr = preg_replace("/<(ul|ol|br|dl|dt|table|caption|\/textarea|tr[^>]*>\s*<(td|th))[^>]*>/i",
- "\n", $goodStr);
- $goodStr = preg_replace("/<li[^>]*>/i", "\n· ", $goodStr);
- $goodStr = preg_replace("/<dd[^>]*>/i", "\n\t", $goodStr);
- $goodStr = preg_replace("/<(th|td)[^>]*>/i", "\t", $goodStr);
- $goodStr = preg_replace("/<a[^>]* href=(\"((?!\"|#|javascript:)[^\"#]*)(\"|#)|'((?!'|#|javascript:)[^'#]*)('|#)|((?!'|\"|>|#|javascript:)[^#\"'> ]*))[^>]*>/i",
- "[LINK: $2$4$6] ", $goodStr);
- $goodStr = preg_replace("/<img[^>]* alt=(\"([^\"]+)\"|'([^']+)'|([^\"'> ]+))[^>]*>/i",
- "[IMAGE: $2$3$4] ", $goodStr);
- $goodStr = preg_replace("/<form[^>]* action=(\"([^\"]+)\"|'([^']+)'|([^\"'> ]+))[^>]*>/i",
- "\n[FORM: $2$3$4] ", $goodStr);
- $goodStr = preg_replace("/<(input|textarea|button|select)[^>]*>/i", "[INPUT] ",
- $goodStr);
- //strip all remaining tags (mostly closing tags)
- $goodStr = strip_tags($goodStr);
- //convert HTML entities
- $goodStr = strtr($goodStr, array_flip(get_html_translation_table(HTML_ENTITIES)));
- preg_replace("/&#(\d+);/me", "chr('$1')", $goodStr);
- //wordwrap
- $goodStr = wordwrap($goodStr);
- //make sure there are no more than 3 linebreaks in a row and trim whitespace
- return preg_replace("/^\n*|\n*$/", '', preg_replace("/[ \t]+(\n|$)/", "$1",
- preg_replace("/\n(\s*\n){2}/", "\n\n\n", preg_replace("/\r\n?|\f/", "\n",
- str_replace(chr(160), ' ', $goodStr)))));
- }
- function parseHealth($res)
- {
- global $vers;
- $res_text = html2text($res);
- $res_text = substr($res_text, strpos($res_text, $vers['text']['Rank progress']));
- $health = trim(get_between($res_text, '[LINK: bloodbank.php]', $vers['text']['Killing skill']));
- $health = str_replace('%', '', $health);
- return $health;
- }
- function getBulletPrice($res)
- {
- $result = $res;
- // Finds the price for each bullet
- $findme = '$';
- $pos = stristr($result, $findme);
- $pos = substr($pos, 1, 3);
- return $pos;
- }
- function getBulletAmount($res)
- {
- global $vers;
- $result = $res;
- $findme = $vers['text']['There are'];
- $pos = stristr($result, $findme);
- $pos = substr($pos, 10, 10);
- $price = explode(" ", $pos);
- return $price[0];
- }
- function buyBullets()
- {
- global $settings, $omerta, $priceChange, $priceSec, $vers;
- $maxPrice = $settings['maxBulletPrice']; //max single bullet price
- $minAmmount = $settings['minAmmountBullets']; //min ammount of bullets to buy
- $moneyForBuying = $settings['minBulletMoney']; //minimal ammount of money needed before you buy bullets
- while (true) {
- if (time() >= $priceChange) {
- $result = get($omerta['bullets'], $omerta['menu']);
- $cash = str_replace(',', '', get_between($result, $vers['text']["You've got"], $vers['text']['in your pocket'])); //parses cash from page
- if ($cash > $moneyForBuying) {
- $price = getBulletPrice($result);
- if ($price > $maxPrice) {
- output("Too expensive to buy, $price", "Bullets");
- $priceChange = time()+rand(4,8);
- return true;
- } else {
- $amount = getBulletAmount($result);
- if ($amount >= $minAmmount) {
- if ($amount >= 400) {
- //race to buy second, not first, helpful since less competition for under 400 :)
- $amountbuy = $amount - 400;
- if ($amountbuy < $minAmmount || $amountbuy > 400)
- $amountbuy = 400;
- } else {
- $amountbuy = $amount;
- }
- output("Buying " . $amountbuy . " of $amount in factory for $price pr. bullet",
- 'Bullets');
- $checkArray = array('<form name="sysbul" action="bullets2.php" method="post">',
- '<input type="text" name="amount_sys" size="8">',
- '<input type="text" name="ver_sys" size="3">',
- '<input type="submit" name="buy_sys" value="Buy">',
- '<input type="hidden" name="curprice"');
- if (inStrArray($checkArray, $result)) {
- saveCaptcha($result, $omerta['bullets']);
- $code = readCode();
- if ($code == "~bc") {
- output("Unviewable captcha, reloading site", "Code");
- buyBullets();
- }
- $post = "amount_sys=$amountbuy&ver_sys=$code&buy_sys=Buy&curprice=$price";
- $result = post($omerta['bullets'], $omerta['bullets'], $post);
- $location = stripos($result, $vers['text']["You don't have"]);
- if ($location > 1) {
- output("You dont have enough cash", 'Bullets');
- return false;
- }
- $location = stripos($result, $vers['text']['This factory does']);
- if ($location > 1) {
- output("Sorry, the factory is out of bullets", 'Bullets');
- $priceChange = time()+rand(4,8);
- return true;
- }
- $location = stripos($result, $vers['text']['The price per bullet just']);
- if ($location > 1) {
- output("The price per bullets have changed", 'Bullets');
- $priceChange = time()+rand(4,8);
- return true;
- }
- $location = stripos($result, $vers['text']['Success, you bought ']);
- if ($location > 1) {
- $price2 = $amountbuy * $price;
- output("Success, you bought $amountbuy bullets for " . $price2 . "$ (" . $price .
- "$)", 'Bullets');
- $priceChange = time()+3660;
- return false;
- }
- if (inStr($vers['text']['The code you verified'], $result)) {
- wrongCode();
- $priceChange = time()+rand(4,8);
- return true;
- }
- }
- } else {
- output("Only " . $amount . " in factory - Not buying", 'Bullets');
- $priceChange = time()+rand(4,8);
- return true;
- }
- }
- } elseif (inStr("src=/static/images/game/generic/criminal.jpg", $result)) {
- iaminjail();
- output("In Jail. . .", 'Bullets');
- return false;
- } else {
- output("Not enough money on pocket. Your money for buying is set to $moneyForBuying",
- 'Bullets');
- write2file('bulletmoney.html', $result);
- return false;
- }
- }
- }
- }
- function buyBlood($ammount)
- {
- global $omerta, $settings, $scriptSite, $vers;
- output("Buying $ammount units of blood", "Bloodbank");
- $res = get($omerta['blood'], $omerta['menu']);
- stillLoggedIn($res);
- // if you are in jail
- if (substr_count($res, $vers['text']['You are in jail for the next']) == 1) {
- iaminjail();
- return;
- }
- verifyBloodInputs($res);
- // check to see if there are options to buy blood, if health is 100% there is no option to buy blood.
- if (substr_count($res, '<option value=') == 0) {
- output("No option to buy blood.", "Bloodbank");
- doSelfBust($res);
- sleep(rand(5, 13));
- return;
- }
- sleep(7 + (rand(1, 4)));
- // if there are still 4 bloodprices get the price from them
- $pos = strpos($res, '$', 0);
- $pos = $pos + 1;
- $bloodpriceA = substr("$res", $pos, 4);
- $pos = strpos($res, '$', $pos);
- $pos = $pos + 1;
- $bloodpriceB = substr("$res", $pos, 4);
- $pos = strpos($res, '$', $pos);
- $pos = $pos + 1;
- $bloodpriceAB = substr("$res", $pos, 4);
- $pos = strpos($res, '$', $pos);
- $pos = $pos + 1;
- $bloodprice0 = substr("$res", $pos, 4);
- $bloodorder = array('A' => $bloodpriceA, 'B' => $bloodpriceB, 'AB' => $bloodpriceAB,
- 0 => $bloodprice0);
- $bloodp = array($bloodpriceA, $bloodpriceB, $bloodpriceAB, $bloodprice0);
- sort($bloodp);
- // If there is 1 option to buy blood get the blood type from it
- if (substr_count($res, '<option value=') == 1) {
- $pos = strpos($res, '<option value=', 0);
- $pos = $pos + 15;
- $bloodtype = substr("$res", $pos, 1);
- // check to see if it still is option 0 as it should be
- if ($bloodtype != 0) {
- output("Bloodtype 0 his option changed", "Bloodbank");
- sleep(10);
- die();
- }
- // setting the buy type to 0 also adding the price
- $buytype = 0;
- $buyprice = $bloodprice0;
- } // end from if with 1 option
- // If there are 2 options to buy blood get the blood type from it
- elseif (substr_count($res, '<option value=') == 2) {
- // get option 1 the bloodtype
- $pos = strpos($res, '<option value=', 0);
- $pos = $pos + 15;
- $bloodtype = substr("$res", $pos, 1);
- // check to see if bloodtype is A or B or 0
- if ($bloodtype != 0) {
- if ($bloodtype != 'A') {
- if ($bloodtype != 'B') {
- write2file('bloodchange.html', $res);
- output("Option of bloodtypes2 changed", "Bloodbank");
- sleep(10);
- die();
- }
- }
- }
- // get option 2 the bloodtype
- $pos = strpos($res, '<option value=', $pos);
- $pos = $pos + 15;
- $bloodtype2 = substr("$res", $pos, 1);
- // check to see if bloodtype is A or B or 0
- if ($bloodtype2 != 0) {
- if ($bloodtype2 != 'A') {
- if ($bloodtype2 != 'B') {
- write2file('bloodchange.html', $res);
- output("Option of bloodtypes2 changed", "Bloodbank");
- sleep(10);
- die();
- }
- }
- }
- $buyoptions = array();
- foreach ($bloodorder as $type => $price) {
- // adding the prices of the bloodtypes that can be bought
- if (($bloodtype == $type) or ($bloodtype2 == $type)) {
- array_push($buyoptions, $price);
- }
- }
- sort($buyoptions);
- foreach ($bloodorder as $type => $price) {
- // if the lowest bloodprice matches the price then the bloodtype + price will be set so we know what to buy against which price
- if ($buyoptions[0] == $price) {
- $buytype = $type;
- $buyprice = $buyoptions[0];
- }
- }
- } // end from if with 2 options
- // If there are 4 options to buy blood get the blood types from it to check if options did not changed
- elseif (substr_count($res, '<option value=') == 4) {
- // get option 1 the bloodtype
- $pos = strpos($res, '<option value=', 0);
- $pos = $pos + 15;
- $bloodtype = substr("$res", $pos, 2);
- // gonna delete '' since bloodtype now also can be 2 letters instead of 1
- $bloodtype = str_replace("\"", "", $bloodtype);
- // check to see if bloodtype is A or B or 0 or AB
- if ($bloodtype != 0) {
- if ($bloodtype != 'A') {
- if ($bloodtype != 'B') {
- if ($bloodtype != 'AB') {
- write2file('blood_change.html', $res);
- output("Option of bloodtypes4 changed", "Bloodbank");
- sleep(10);
- die();
- }
- }
- }
- }
- // get option 2 the bloodtype
- $pos = strpos($res, '<option value=', $pos);
- $pos = $pos + 15;
- $bloodtype2 = substr("$res", $pos, 2);
- // gonna delete '' since bloodtype now also can be 2 letters instead of 1
- $bloodtype2 = str_replace("\"", "", $bloodtype2);
- // check to see if bloodtype is A or B or 0 or AB
- if ($bloodtype2 != 0) {
- if ($bloodtype2 != 'A') {
- if ($bloodtype2 != 'B') {
- if ($bloodtype2 != 'AB') {
- write2file('blood_change.html', $res);
- output("Option of bloodtypes4 changed", "Bloodbank");
- sleep(10);
- die();
- }
- }
- }
- }
- // get option 3 the bloodtype
- $pos = strpos($res, '<option value=', $pos);
- $pos = $pos + 15;
- $bloodtype3 = substr("$res", $pos, 2);
- // gonna delete '' since bloodtype now also can be 2 letters instead of 1
- $bloodtype3 = str_replace("\"", "", $bloodtype3);
- // check to see if bloodtype is A or B or 0 or AB
- if ($bloodtype3 != 0) {
- if ($bloodtype3 != 'A') {
- if ($bloodtype3 != 'B') {
- if ($bloodtype3 != 'AB') {
- write2file('blood_change.html', $res);
- output("Option of bloodtypes4 changed", "Bloodbank");
- sleep(10);
- die();
- }
- }
- }
- }
- // get option 4 the bloodtype
- $pos = strpos($res, '<option value=', $pos);
- $pos = $pos + 15;
- $bloodtype4 = substr("$res", $pos, 2);
- // gonna delete '' since bloodtype now also can be 2 letters instead of 1
- $bloodtype4 = str_replace("\"", "", $bloodtype3);
- // check to see if bloodtype is A or B or 0 or AB
- if ($bloodtype4 != 0) {
- if ($bloodtype4 != 'A') {
- if ($bloodtype4 != 'B') {
- if ($bloodtype4 != 'AB') {
- write2file('blood_change.html', $res);
- output("Option of bloodtypes4 changed", "Bloodbank");
- sleep(10);
- die();
- }
- }
- }
- }
- foreach ($bloodorder as $type => $price) {
- // if the lowest bloodprice matches the price then the bloodtype + price will be set so we know what to buy against which price
- if ($bloodp[0] == $price) {
- $buytype = $type;
- $buyprice = $bloodp[0];
- }
- }
- } // end from if with 4 options
- // if the bloodprice is lower then the max price blood may cost then buy it
- if (trim($buyprice) <= trim($settings['maxBloodPrice'])) {
- // http://www.barafranca.com/bloodbank.php?UnitstoBuy=10&BuyType=0&Buy=Buy%21
- $get = "?UnitstoBuy=" . $ammount . "&BuyType=" . $buytype . "&Buy=Buy%21";
- $omerta['blood'] = $GLOBALS['vers']['omertaURL_NS'] . '/bloodbank.php';
- $get = $omerta['blood'] . $get;
- $res = get($get, $omerta['blood']);
- write2file('bloodchange.html', $res);
- // checking if you had enough money for it
- if (substr_count($res, $vers['text']["You don't have enough"]) == 1) {
- output("You do not have enough money to buy blood.", "Bloodbank");
- sleep(5 + (rand(1, 8)));
- }
- // check to see if you did not allrdy bought in the last 45min
- if (substr_count($res, $vers['text']['Sorry, you can only buy blood once every 45 minutes.']) ==
- 1) {
- output("Failed to buy blood cause you bought it in the last 45 min.",
- "Bloodbank");
- sleep(5 + (rand(1, 9)));
- }
- // checking if you bought it.
- elseif ((substr_count($res, $vers['text']['bought']) == 1) and (substr_count($res,
- '$') == 1)) {
- // getting amount of units bought + total price paid for it
- $pos = strpos($res, $vers['text']['bought'], 0);
- $pos = $pos + 7;
- $unitsbought = substr("$res", $pos, 2);
- $pos = strpos($res, '$', $pos);
- $pos = $pos + 1;
- $totalprice = substr("$res", $pos, 7);
- // deleting a few letters which are in there if the price is low.
- $totalprice = str_replace("p", "", $totalprice);
- $totalprice = str_replace("e", "", $totalprice);
- $totalprice = str_replace("r", "", $totalprice);
- output("Bought $unitsbought units of blood for a price of: $totalprice",
- "Bloodbank");
- // units are bought could put a timer here that it does not buy for the next 45min? however how often are you buying blood?
- sleep(3 + (rand(1, 7)));
- } // end from elseif that you bought it
- // check to see if you did not allrdy bought in the last 45min
- elseif (substr_count($res,
- 'You do not have enough health missing to buy that amount of blood.') == 1) {
- output("You do not have enough health missing to buy that amount of blood. :s",
- "Bloodbank");
- sleep(5 + (rand(1, 10)));
- }
- } // end from if the price is lower then the max price
- // else the bloodprice is to high
- else {
- output("The bloodprice is to high to buy it. $buyprice ", "Bloodbank");
- sleep(4 + (rand(1, 6)));
- } // end else
- } // buyblood($ammount)
- function verifyBloodInputs($res)
- {
- global $omerta;
- // going to check if omerta there are still 5 input names.
- if (substr_count($res, 'name=') != 3) {
- // should be 3
- output("Total amount names changed substr_count($res,'name=')", "Bloodbank");
- write2file('bloodchange.html', $res);
- sleep(10);
- die();
- }
- // going to check if omerta there inputs did not changed names
- if (substr_count($res, 'name="UnitstoBuy"') != 1) {
- output("Bloodpage was changed. (stop script)", "Bloodbank");
- write2file('bloodchange.html', $res);
- sleep(10);
- die();
- }
- if (substr_count($res, 'name="BuyType"') != 1) {
- output("Bloodpage was changed. (stop script)", "Bloodbank");
- write2file('bloodchange.html', $res);
- sleep(10);
- die();
- }
- if (substr_count($res, 'name="Buy"') != 1) {
- output("Bloodpage was changed. (stop script)", "Bloodbank");
- write2file('bloodchange.html', $res);
- sleep(10);
- die();
- }
- // going to check if omerta there inputvalue from submit did not changed name
- if (substr_count($res, 'value="Buy!"') != 1) {
- output("Hidden value was changed. (stop script)", "Bloodbank");
- write2file('bloodchange.html', $res);
- sleep(10);
- die();
- }
- // checking if action still is self
- $actionlocation = 'action="bloodbank.php"';
- if (substr_count($res, $actionlocation) != 1) {
- output("Action was changed. (do not run script) $actionlocation ", "Bloodbank");
- write2file('bloodchange.html', $res);
- sleep(10);
- die();
- }
- // check to see if there are still 4 bloodprices.
- if (substr_count($res, '$') != 4) {
- output("There are not enough bloodprices. ", "Bloodbank");
- write2file('bloodchange.html', $res);
- sleep(10);
- die();
- }
- } // end verifyBloodInputs
- function verifyreply($readbomsg)
- {
- global $vers;
- // going to check if omerta there inputs did not changed names
- if ((substr_count($readbomsg, 'value=') != 4) && (substr_count($readbomsg,
- 'name=') != 5)) {
- // should be 4 5 value/name
- output("Total amount of values/names changed substr_count($readbomsg , 'value=') (substr_count($readbomsg , 'name=') ",
- "Reply msg");
- write2file('repmsg.html', $readbomsg);
- sleep(10);
- die();
- }
- if (substr_count($readbomsg, 'name=send value=yes>') != 1) {
- output("Names+values got changed. (not sending any msgs out)", "Reply msg");
- write2file('repmsg.html', $readbomsg);
- sleep(10);
- die();
- }
- if (substr_count($readbomsg, 'name=nick size=55 value=') != 1) {
- output("Names+values got changed. (not sending any msgs out)", "Reply msg");
- write2file('repmsg.html', $readbomsg);
- sleep(10);
- die();
- }
- if (substr_count($readbomsg, 'name=subject') != 1) {
- output("Names+values got changed. (not sending any msgs out)", "Reply msg");
- write2file('repmsg.html', $readbomsg);
- sleep(10);
- die();
- }
- if ((substr_count($readbomsg, 'value="Re: ' . $vers['text']['Bustout'] . '"') !=
- 1) && (substr_count($readbomsg, 'value="Re: ' . $vers['text']['Bailed'] . '"') !=
- 1)) {
- output("Names+values got changed. (not sending any msgs out)", "Reply msg");
- write2file('repmsg.html', $readbomsg);
- sleep(10);
- die();
- }
- if (substr_count($readbomsg, 'name=msg>') != 1) {
- output("Names+values got changed. (not sending any msgs out)", "Reply msg");
- write2file('repmsg.html', $readbomsg);
- sleep(10);
- die();
- }
- if (substr_count($readbomsg, 'type=submit value="' . $vers['text']['Send'] .
- '"></form>') != 1) {
- output("Names+values got changed. (not sending any msgs out)", "Reply msg");
- write2file('repmsg.html', $readbomsg);
- sleep(10);
- die();
- }
- // checking if action still is self
- $actionlocation = 'action=msg.php method=post';
- if (substr_count($readbomsg, $actionlocation) != 1) {
- output("Action was changed. (do not run script) ", "Reply msg");
- write2file('repmsg.html', $readbomsg);
- sleep(12);
- die();
- }
- } // end verify reply
- function findinside($start, $end, $string)
- {
- preg_match_all('/' . preg_quote($start, '/') . '([^\.)]+)' . preg_quote($end,
- '/') . '/i', $string, $m);
- return $m[1];
- }
- function replybo($ress, $ID, $lastlink)
- {
- global $omerta, $vers;
- // if the reply action did not change
- if ((substr_count($ress, 'msg.php?replyid=' . $ID) == 1) && (substr_count($ress,
- 'alt="' . $vers['text']['Delete'] .
- '"></a> | <a href="msg.php?replyid=') == 1)) {
- sleep(rand(2, 5));
- $readbomsg = get($GLOBALS['vers']['omertaURL_NS'] . "/msg.php?replyid=" . $ID, $lastlink);
- stillLoggedIn($readbomsg);
- verifyreply($readbomsg);
- // get the person to send the reply to
- $sendnick = findinside('name=nick size=55 value=', '></td></tr>', $readbomsg);
- // get the right subject for the reply msg
- if (substr_count($readbomsg, 'value="Re: ' . $vers['text']['Bustout'] . '"') ==
- 1) {
- $subject = 'Re: Bustout!';
- }
- if (substr_count($readbomsg, 'value="Re: ' . $vers['text']['Bailed'] . '"') == 1) {
- $subject = 'Re: Bailed!';
- }
- // check to see if subject is good
- if (($subject == false) or (is_numeric($subject))) {
- output("The subject is not good $subject", "Send Reply");
- write2file('sendmsg.html', $readbomsg);
- sleep(10);
- die();
- }
- // check to see if the person that gets the msg is good
- if ($sendnick[0] == false) {
- output("The sendnick is not good $sendnick[0]", "Send Reply");
- write2file('sendmsg.html', $readbomsg);
- sleep(10);
- die();
- }
- // getting the ty msg from jail.txt
- $messages = array();
- if (is_readable("jail.txt")) {
- $fp = fopen("jail.txt", 'r'); //open jail.txt for reading
- while ($line = fgets($fp))
- $messages[] = trim($line); //if there is a line read it to array
- fclose($fp); //close fiel handle
- } //is_readable
- $msg = @$messages[array_rand($messages)];
- // if there is no msg due to empty line get a random one yourself
- if (trim($msg) == '') {
- // output("No msg was found in the jail.txt file (empty line? using default msg", "Sending msg");
- $messages = array('thank you', 'thnx', 'thanks', 'ty');
- $msg = @$messages[array_rand($messages)];
- }
- // get the msg to reply on
- $readbomsgg = str_replace(".", "~", $readbomsg);
- $test = findinside('[B]', '[HR]', $readbomsgg);
- $test[0] = str_replace("~", ".", $test[0]);
- $test[0] = '[B]' . $test[0] . '[HR]';
- $test[0] = "$test[0] $msg";
- // encoding url to send
- $test[0] = urlencode($test[0]);
- $subject = urlencode($subject);
- $post = "send=yes&nick=$sendnick[0]&subject=$subject&msg=$test[0]";
- sleep(rand(4, 11));
- $sendtymsg = post($GLOBALS['vers']['omertaURL_NS'] . "/msg.php", $GLOBALS['vers']['omertaURL_NS'] .
- "/msg.php?replyid=" . $ID, $post);
- stillLoggedIn($sendtymsg);
- $msgsend = findinside($vers['text']['Message'] . ' ', '<br /><meta http', $sendtymsg);
- if ($msgsend == false) {
- output("Messsage did not got sent?", "Thank bust/bail");
- write2file('sendmsg.html', $sendtymsg);
- sleep(rand(1, 2));
- }
- if ($msgsend[0] != false) {
- output("$msgsend[0]", "Thank bust/bail");
- sleep(rand(1, 2));
- }
- } // end from if the reply link did not got changed
- // the reply link got changed msg.php
- else {
- output("Reply link got changed not gonna send a reply", "Reading msg");
- write2file('messages.html', $ress);
- sleep(rand(1, 2));
- return;
- }
- } // end replybo
- function doBust()
- {
- global $omerta, $settings, $scriptSite, $vers;
- $res = get($omerta['jail'], $omerta['menu']);
- stillLoggedIn($res);
- if (!inStr($vers['text']["You are not"], $res)) {
- $res = get($omerta['jail'], $omerta['menu']);
- }
- $res = removeBetween('<--', '-->', $res);
- $res = removeBetween('<!--', '-->', $res);
- if (!inStr($vers['text']['You are in jail for the next'], $res)) {
- //Friends jailers
- $famjailers = substr_count($res, "<tr bgcolor=\"yellow\">");
- $jailers = substr_count($res, "type=\"radio\"");
- $friendjailers = substr_count($res, "<tr bgcolor=\"#DBDBDB\">");
- if (!(inStr("<form name=\"jail\" action=\"jail.php\" method=\"post\">", $res))) {
- output("Formula changed", "Bust");
- write2file("jailChange.html", $res);
- sleep(5);
- die();
- } //end if
- if (!substr_count($res, "type=\"radio\"") == $jailers) {
- output("Too many radio bottoms", "Bust");
- write2file("jailChange.html", $res);
- sleep(5);
- die();
- } //end if
- if (!(inStr("<input name=\"ver\" size=\"3\" type=\"text\">", $res))) {
- output("Hidden value changed", "Bust");
- write2file("jailChange.html", $res);
- sleep(5);
- die();
- } //end if
- if ($jailers > 1) {
- if ($famjailers >= 1) {
- $type = "Friend";
- $rdm = rand(1, $famjailers);
- for ($i = 1; $famjailers >= $i; $i++) {
- if ($i == $rdm) {
- $name = explode("<tr bgcolor=\"yellow\">", $res);
- $posstart = strpos($name[$i], "<td>");
- $posend = strpos($name[$i], "</td>");
- $name = substr($name[$i], $posstart, $posend - $posstart);
- $name = preg_replace("#<a(.*?)>#im", "", $name);
- $name = str_replace("<td>", "", $name);
- $name = str_replace("</a>", "", $name);
- #Doing an attempt
- $str = explode("<tr bgcolor=\"yellow\">", $res);
- $str = explode("<input name=\"bust\" value=", $str[$i]);
- $check = strpos(substr($str[1], 0, 40), "type=\"radio\"");
- if ($check > 0) {
- $str = substr($str[1], 0, 20);
- $str = explode("\"", $str);
- $jid = $str[1];
- }
- }
- }
- } elseif ($friendjailers >= 1) {
- $type = "Family member";
- $rdm = rand(1, $friendjailers);
- for ($i = 1; $friendjailers >= $i; $i++) {
- if ($i == $rdm) {
- $name = explode("<tr bgcolor=\"#DBDBDB\">", $res);
- $posstart = strpos($name[$i], "<td>");
- $posend = strpos($name[$i], "</td>");
- $name = substr($name[$i], $posstart, $posend - $posstart);
- $name = preg_replace("#<a(.*?)>#im", "", $name);
- $name = str_replace("<td>", "", $name);
- $name = str_replace("</a>", "", $name);
- #Doing an attempt
- $str = explode("<tr bgcolor=\"#DBDBDB\">", $res);
- $str = explode("<input name=\"bust\" value=", $str[$i]);
- $check = strpos(substr($str[1], 0, 40), "type=\"radio\"");
- if ($check > 0) {
- $str = substr($str[1], 0, 20);
- $str = explode("\"", $str);
- $jid = $str[1];
- }
- }
- }
- } else {
- $type = "Random";
- $rdm = rand(2, $jailers);
- for ($i = 2; $jailers >= $i; $i++) {
- if ($i == $rdm) {
- $name = explode("<tr bgcolor=", $res);
- $name[$i - 1];
- $posstart = strpos($name[$i - 1], "<td>");
- $posend = strpos($name[$i - 1], "</td>");
- $name = substr($name[$i - 1], $posstart, $posend - $posstart);
- $name = preg_replace("#<a(.*?)>#im", "", $name);
- $name = str_replace("<td>", "", $name);
- $name = str_replace("</a>", "", $name);
- #Doing an attempt
- $str = explode("<input name=\"bust\" value=", $res);
- $check = strpos(substr($str[$i], 0, 40), "type=\"radio\"");
- if ($check > 0) {
- $str = substr($str[$i], 0, 20);
- $str = explode("\"", $str);
- $jid = $str[1];
- }
- }
- }
- }
- if (!(inStr("<input name=\"bust\" value=", $res))) {
- output("Name value changed", "Bust");
- write2file("jailChange.html", $res);
- sleep(5);
- die();
- } //end if
- #SAVE CAPTCHA
- saveCaptcha($res, $omerta['jail']);
- $code = readCode();
- if ($code == "~bc") {
- output("Unviewable captha, reloading site", "Code");
- doBust();
- }
- $code = str_replace('-', '', $code);
- $post = "ver=" . $code . "&bust=" . $jid;
- if (strlen($code) != 3) {
- return $code;
- }
- if (strlen($post) <= 5) {
- output('No Typers. . .', 'Bust');
- return false;
- }
- $action = $GLOBALS['vers']['omertaURL_NS'] . "/jail.php";
- $res = post($action, $omerta['jail'], "$post"); #$omerta['jail'] is that set ?
- #ID of jailer for the post is $jid
- $location = stripos($res, $vers['text']['You are in jail for the next']);
- if ($location > 1) {
- output("Failed busting $name - ($type)", "Bust");
- doSelfBust($res);
- }
- $location1 = substr_count($res, $vers['text']["freed"]);
- if ($location1 >= 1) {
- output("The person was already freed, $name ($type)", "Bust");
- return 0;
- }
- $location2 = substr_count($res, $vers['text']['The code you']);
- if ($location2 >= 1) {
- wrongCode();
- return false;
- }
- $location3 = substr_count($res, $vers['text']["You busted"]);
- if ($location3 >= 1) {
- output("Succeeded, you busted $name - ($type)", "Bust");
- return 1;
- }
- }
- } else {
- iaminjail();
- output("Jail..", "Bust");
- doSelfBust($res);
- sleep(10);
- return true;
- }
- }
- function checkEnglish($res)
- {
- global $vers;
- if($vers['version']!='com'&&$vers['version']!='dm') {
- return;
- }
- // Check to see if status page is in english put the words you want to check in the array under here then script checks if they are in $res if it doesn't script will stop
- $checkenglish = array('Bullets', 'Cash', 'Rank', 'Kills', 'Killing',
- 'experience');
- $resultenglish = count($checkenglish);
- $englishcount = 0;
- foreach ($checkenglish as $woord) {
- if (strpos($res, $woord)) {
- // found the word in the array giving englishcount +1
- $englishcount = $englishcount + 1;
- }
- }
- // if they don't match then scripts will stop
- if ($englishcount != $resultenglish) {
- output('Only run this script in ENGLISH on this version');
- output('Now changing your language :). . .');
- global $omerta;
- get($GLOBALS['vers']['omertaURL_NS'] . '/profile.php', $omerta['menu']);
- post($GLOBALS['vers']['omertaURL_NS'] . '/profile.php', $GLOBALS['vers']['omertaURL_NS'] .
- '/profile.php', 'type=language&language=en');
- output('Language changed to English');
- die();
- }
- // else the script can continue to run
- } // checkEnglish end
- function getTimeFrom()
- {
- $year = date("Y", time());
- $day = date("j", time());
- $month = date("m", time());
- $second = date("s", time());
- if ($second > 38) {
- $minute = date("i", time()) + 1;
- } else {
- $minute = date("i", time());
- }
- $hour = date("G", time());
- $buyTime = mktime($hour, $minute, 40, $month, $day, $year);
- return $buyTime;
- }
- function getTimeTo()
- {
- $year = date("Y", time());
- $day = date("j", time());
- $month = date("m", time());
- $second = date("s", time());
- if ($second > 38) {
- $minute = date("i", time()) + 2;
- } else {
- $minute = date("i", time()) + 1;
- }
- $hour = date("G", time());
- $buyTime = mktime($hour, $minute, 20, $month, $day, $year);
- return $buyTime;
- }
- function checkGambling($res)
- {
- if (substr_count($res, '<a href=roulette.php?casino=') == 0) {
- output("Page got changed (or bad load)", "Gambling");
- write2file('gambling.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, $vers['text']['Gambling District'] . '</b>') != 1) {
- output("Page got changed (or bad load)", "Gambling");
- write2file('gambling.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '<form') != 0) {
- output("Page got changed (or bad load)", "Gambling");
- write2file('gambling.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '<input') != 0) {
- output("Page got changed (or bad load)", "Gambling");
- write2file('gambling.html', $res);
- sleep(12);
- die();
- }
- } // checkGambling($res)
- function openGamble()
- {
- global $omerta, $settings, $scriptSite;
- output("Pray for me to win you some extra cash", "Gamble");
- $res = get($omerta['gamble'], $omerta['menu']);
- stillLoggedIn($res);
- $res = removeBetween('<--', '-->', $res);
- $res = removeBetween('<!--', '-->', $res);
- // if you are in jail
- if (substr_count($res, $vers['text']['You are in jail for the next']) == 1) {
- output("Jailed. . .", "Gamble");
- doSelfBust($res);
- return;
- }
- checkGambling($res);
- // get the id from the casino's
- $casinoID = findinside('<a href=roulette.php?casino=', '>', $res);
- // get a random casino id from array in case script is in vegas
- $casinoID = @$casinoID[array_rand($casinoID)];
- if (!(is_numeric($casinoID))) {
- output("Wrong casino id :S $casinoID", "Gambling");
- write2file('gambling.html', $res);
- sleep(16);
- die();
- }
- $casinoLink = $GLOBALS['vers']['omertaURL_NS'] .
- '/gambling/roulette.php?casino=' . $casinoID;
- $res = get($casinoLink, $omerta['gamble']);
- stillLoggedIn($res);
- $res = removeBetween('<--', '-->', $res);
- $res = removeBetween('<!--', '-->', $res);
- checkRoul($res);
- gambleRoul($res, $casinoLink);
- } // end openGamble()
- function checkRoul($res)
- {
- if (substr_count($res, '<input') != 53) {
- output("Page got changed (or bad load)", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '<form method="post" action="roulette.php">') != 1) {
- output("Method or action got changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '<input type=hidden name=casino value=') != 1) {
- output("Casino value input changed)", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '<input type="Hidden" size=2 name=x value=1>') != 1) {
- output("Hidden value changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '</font>0:<input type=text size=5 name=z>') != 1) {
- output("Value 0 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '1-18:<br><input type=text size=5 name=eta>') != 1) {
- output("Value 1-18 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '1-12:<br><input type=text size=5 name=ett>') != 1) {
- output("Value 1-12 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '01:<input type=text size=5 name=1>') != 1) {
- output("Value 1 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '02:<input type=text size=5 name=2>') != 1) {
- output("Value 2 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '03:<input type=text size=5 name=3>') != 1) {
- output("Value 3 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '04:<input type=text size=5 name=4>') != 1) {
- output("Value 4 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '05:<input type=text size=5 name=5>') != 1) {
- output("Value 5 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '06:<input type=text size=5 name=6>') != 1) {
- output("Value 6 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '07:<input type=text size=5 name=7>') != 1) {
- output("Value 7 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '08:<input type=text size=5 name=8>') != 1) {
- output("Value 8 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '09:<input type=text size=5 name=9>') != 1) {
- output("Value 9 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '10:<input type=text size=5 name=10>') != 1) {
- output("Value 10 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '11:<input type=text size=5 name=11>') != 1) {
- output("Value 11 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '12:<input type=text size=5 name=12>') != 1) {
- output("Value 12 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '13:<input type=text size=5 name=13>') != 1) {
- output("Value 13 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '14:<input type=text size=5 name=14>') != 1) {
- output("Value 14 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '15:<input type=text size=5 name=15>') != 1) {
- output("Value 15 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '16:<input type=text size=5 name=16>') != 1) {
- output("Value 16 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '17:<input type=text size=5 name=17>') != 1) {
- output("Value 17 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '18:<input type=text size=5 name=18>') != 1) {
- output("Value 18 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '19:<input type=text size=5 name=19>') != 1) {
- output("Value 19 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '20:<input type=text size=5 name=20>') != 1) {
- output("Value 20 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '21:<input type=text size=5 name=21>') != 1) {
- output("Value 21 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '22:<input type=text size=5 name=22>') != 1) {
- output("Value 22 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '23:<input type=text size=5 name=23>') != 1) {
- output("Value 23 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '24:<input type=text size=5 name=24>') != 1) {
- output("Value 24 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '25:<input type=text size=5 name=25>') != 1) {
- output("Value 25 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '26:<input type=text size=5 name=26>') != 1) {
- output("Value 26 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '27:<input type=text size=5 name=27>') != 1) {
- output("Value 27 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '28:<input type=text size=5 name=28>') != 1) {
- output("Value 28 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '29:<input type=text size=5 name=29>') != 1) {
- output("Value 29 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '30:<input type=text size=5 name=30>') != 1) {
- output("Value 30 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '31:<input type=text size=5 name=31>') != 1) {
- output("Value 31 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '32:<input type=text size=5 name=32>') != 1) {
- output("Value 32 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '33:<input type=text size=5 name=33>') != 1) {
- output("Value 33 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '34:<input type=text size=5 name=34>') != 1) {
- output("Value 34 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '35:<input type=text size=5 name=35>') != 1) {
- output("Value 35 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '36:<input type=text size=5 name=36>') != 1) {
- output("Value 36 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, $vers['text']['even'] .
- ':<br><input type=text size=5 name=e>') != 1) {
- output("Value even changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, $vers['text']['red'] .
- ':<br><input type=text size=5 name=r>') != 1) {
- output("Value red changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '13-24:<br><input type=text size=5 name=dtv>') != 1) {
- output("Value 13-24 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, $vers['text']['black'] .
- ':<br><input type=text size=5 name=b>') != 1) {
- output("Value black changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, $vers['text']['odd'] .
- ':<br><input type=text size=5 name=o>') != 1) {
- output("Value odd changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '25-36:<br><input type=text size=5 name=vtz>') != 1) {
- output("Value 25-36 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '19-36:<br><input type=text size=5 name=ntz>') != 1) {
- output("Value 19-36 changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '<input type=text size=5 name=ek>') != 1) {
- output("Value 1st changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '<input type=text size=5 name=tk>') != 1) {
- output("Value 2nd changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '<input type=text size=5 name=dk>') != 1) {
- output("Value 3rd changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '<input type=submit value="' . $vers['text']['Gamble'] .
- '">') != 1) {
- output("Value submit=gamble changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- if (substr_count($res, '<input type=reset value="">') != 1) {
- output("Value reset= changed", "Roulette");
- write2file('roul.html', $res);
- sleep(12);
- die();
- }
- } // checkRoul($res)
- function gambleRoul($res, $ref)
- {
- global $omerta, $settings, $scriptSite, $vers;
- if ($settings['numberRoul'] == 0)
- $settings['numberRoul'] = 'z';
- $maxBetNumbers = findinside($vers['text']['Maximum Bet on numbers'] . ' <b>$',
- '</b>', $res);
- $maxBetNumbers = trim(str_replace(",", "", $maxBetNumbers[0]));
- $numberGamble = $settings['numberRoul'];
- if ($maxBetNumbers == 0) {
- output("Maxbet is set to 0 :(", "Roulette");
- return;
- }
- if ($maxBetNumbers > $settings['betRoul']) {
- $gambleamount = $settings['betRoul'];
- output("Gambling with $gambleamount on $numberGamble", "Roulette");
- $gambleamount = $settings['betRoul'];
- }
- if ($maxBetNumbers < $settings['betRoul']) {
- output("Gambling with $maxBetNumbers (maxbet is lower then your settings) on $numberGamble",
- "Roulette");
- $gambleamount = $maxBetNumbers;
- }
- $nr = 1;
- while ($nr <= 36) //gambling 36 times max
- {
- $maxBetNumbers = findinside('Maximum Bet on numbers: <b>$', '</b>', $res);
- $maxBetNumbers = trim(str_replace(",", "", $maxBetNumbers[0]));
- if ($maxBetNumbers < $gambleamount) {
- output("Gay owner lowered maxbet so need to stop gambling :(", "Roulette");
- return;
- }
- $casinoValue = findinside('<input type=hidden name=casino value=',
- '<input type="Hidden"', $res);
- $casValue = trim(str_replace(">", "", $casinoValue[0]));
- if (!(is_numeric($casValue))) {
- output("Wrong casinovalue :S $casValue so will not gamble", "Roulette");
- write2file('roul.html', $res);
- sleep(16);
- return;
- }
- // casino=7&x=1&z=&eta=&ett=&1=1&2=&3=&4=&5=&6=&e=&7=&8=&9=&10=&11=&12=&r=&dtv=&13=&14=&15=&16=&17=&18=&b=&19=&20=&21=&22=&23=&24=&o=&vtz=&25=&26=&27=&28=&29=&30=&ntz=&31=&32=&33=&34=&35=&36=&ek=&tk=&dk=
- $post = preg_replace('/' . '&' . $numberGamble . '=/', '&' . $numberGamble . '=' .
- $gambleamount, '&z=&eta=&ett=&1=&2=&3=&4=&5=&6=&e=&7=&8=&9=&10=&11=&12=&r=&dtv=&13=&14=&15=&16=&17=&18=&b=&19=&20=&21=&22=&23=&24=&o=&vtz=&25=&26=&27=&28=&29=&30=&ntz=&31=&32=&33=&34=&35=&36=&ek=&tk=&dk=');
- $post = 'casino=' . $casValue . '&x=1' . $post;
- // output("$post");
- output(" $gambleamount");
- if ($nr == 1) {
- $res = post($GLOBALS['vers']['omertaURL_NS'] . '/gambling/roulette.php', $ref, $post);
- $ref = $GLOBALS['vers']['omertaURL_NS'] . '/gambling/roulette.php';
- write2file('roul.html', $res);
- } elseif ($nr != 1) {
- $res = post($GLOBALS['vers']['omertaURL_NS'] . '/gambling/roulette.php', $ref, $post);
- write2file('roul.html', $res);
- }
- stillLoggedIn($res);
- $res = removeBetween('<--', '-->', $res);
- $res = removeBetween('<!--', '-->', $res);
- checkRoul($res);
- $winningNumber = trim(getBetween($res, '<b style="font-size: 40;">', '</b>'));
- if (substr_count($res, '<font color=red>') == 1) {
- output("Lost your bet of $gambleamount the winning number was $winningNumber",
- "Roulette");
- if ($nr == 36)
- output("Lost 36 times $gambleamount will stop now :(", "Roulette");
- }
- if (substr_count($res, '<font color=green>') == 1) {
- $winningAmount = findinside('<font color=green>', '</font></b></center>', $res);
- output("You won $winningAmount[0] after $nr tries.", "Roulette");
- return;
- }
- if (substr_count($res, $vers['text']['got enough cash to do this']) == 1) {
- output("Not enough cash anymore :(", "Roulette");
- return;
- }
- if (substr_count($res, 'You can only gamble for') == 1) {
- output("Gay owner lowered maxbet so need to stop gambling :(", "Roulette");
- return;
- }
- $nr++;
- sleep(rand(2, 5));
- }
- } // end gambleRoul($res,$casinoLink)
- function displayStats()
- {
- global $stats;
- echo "---===Current Script Statistics===---\r\n";
- output($stats['code']['typer'], "Codes (Typer)");
- output($stats['code']['cache'], "Codes (Cache)");
- output($stats['code']['wrong'], "Codes (Wrong)");
- output($stats['code']['total'], "Codes (Total)");
- echo "\r\n";
- output($stats['crimes']['successful'], "Crimes (Successful)");
- output($stats['crimes']['failed'], "Crimes (Failed)");
- output($stats['crimes']['caught'], "Crimes (Caught)");
- output($stats['crimes']['foot'], "Crimes (Foot)");
- output($stats['crimes']['total'], "Crimes (Total)");
- echo "\r\n";
- output($stats['nick']['successful'], "Nick (Successful)");
- output($stats['nick']['failed'], "Nick (Failed)");
- output($stats['nick']['caught'], "Nick (Caught)");
- output($stats['nick']['total'], "Nick (Total)");
- echo "---===Current Script Statistics===---\r\n";
- } //displayStats
- function loadStats()
- {
- global $stats;
- if (!file_exists('stats.txt')) {
- $stats['code']['wrong'] = 0;
- $stats['code']['typer'] = 0;
- $stats['code']['cache'] = 0;
- $stats['code']['total'] = 0;
- $stats['crimes']['total'] = 0;
- $stats['crimes']['successful'] = 0;
- $stats['crimes']['failed'] = 0;
- $stats['crimes']['caught'] = 0;
- $stats['crimes']['foot'] = 0;
- $stats['nick']['total'] = 0;
- $stats['nick']['successful'] = 0;
- $stats['nick']['failed'] = 0;
- $stats['nick']['caught'] = 0;
- } else {
- parse_str(file_get_contents('stats.txt'), $stats);
- } //else
- } //loadStats
- function saveStats()
- {
- global $stats;
- $string = "code[wrong]=" . $stats['code']['wrong'] . "&code[typer]=" . $stats['code']['typer'] .
- "&code[cache]=" . $stats['code']['cache'] . "&code[total]=" . $stats['code']['total'] .
- "&crimes[total]=" . $stats['crimes']['total'] . "&crimes[successful]=" . $stats['crimes']['successful'] .
- "&crimes[failed]=" . $stats['crimes']['failed'] . "&crimes[caught]=" . $stats['crimes']['caught'] .
- "&crimes[foot]=" . $stats['crimes']['foot'] . "&nick[total]=" . $stats['nick']['total'] .
- "&nick[successful]=" . $stats['nick']['successful'] . "&nick[failed]=" . $stats['nick']['failed'] .
- "&nick[caught]=" . $stats['nick']['caught'];
- write2file('stats.txt', $string);
- $page = "<HTML>
- <HEAD>
- <title>Script Stats</title>
- <LINK REL=StyleSheet HREF=\"http://www.3nvisi0n.net/Enigma/static/css/game/style.css\" TYPE=\"text/css\" >
- <style type=\"text/css\">
- <!--
- .style1 {font-size: 24px}
- -->
- </style>
- </HEAD>
- <BODY bgcolor=\"#ffffff\">
- <center>
- <p class=\"style1\">Omerta Enigma - Script Statistics</p>
- <table width=\"60%\" height=\"23\" border=\"0\">
- <tr>
- <th width=\"31%\"><table class=thinline width=\"277\" border=\"0\" align=\"center\">
- <tr>
- <td width=\"269\" height=\"12\" class=tableheader><div align=\"center\">Codes</div></td>
- </tr>
- <tr>
- <td><table width=\"95%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">
- <tr>
- <td width=\"37%\"><div align=\"center\"><strong>By Typer </strong></div></td>
- <td width=\"63%\"><div align=\"left\">" . $stats['code']['typer'] .
- "</div></td>
- </tr>
- <tr>
- <td><div align=\"center\"><strong>From Cache </strong></div></td>
- <td><div align=\"left\">" . $stats['code']['cache'] .
- "</div></td>
- </tr>
- <tr>
- <td><div align=\"center\"><strong>Wrong </strong></div></td>
- <td><div align=\"left\">" . $stats['code']['wrong'] .
- "</div></td>
- </tr>
- <tr>
- <td><div align=\"center\"><strong>Total</strong></div></td>
- <td><div align=\"left\">" . $stats['code']['total'] .
- "</div></td>
- </tr>
- </table></td>
- </tr>
- </table>
- <center>
- </center>
- <p><br>
- </p>
- <th width=\"37%\"><table class=thinline width=\"262\" border=\"0\" align=\"center\">
- <tr>
- <td width=\"262\" height=\"12\" class=tableheader><div align=\"center\">Crimes</div></td>
- </tr>
- <tr>
- <td><table width=\"95%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">
- <tr>
- <td width=\"22%\"><div align=\"center\"><strong>Successful</strong></div></td>
- <td width=\"78%\"><div align=\"left\">" . $stats['crimes']['successful'] .
- "</div></td>
- </tr>
- <tr>
- <td><div align=\"center\"><strong>Failed</strong></div></td>
- <td><div align=\"left\">" . $stats['crimes']['failed'] .
- "</div></td>
- </tr>
- <tr>
- <td><div align=\"center\"><strong>Caught</strong></div></td>
- <td><div align=\"left\">" . $stats['crimes']['caught'] .
- "</div></td>
- </tr>
- <tr>
- <td><div align=\"center\"><strong>Foot</strong></div></td>
- <td><div align=\"left\">" . $stats['crimes']['foot'] .
- "</div></td>
- </tr>
- <tr>
- <td><div align=\"center\"><strong>Total</strong></div></td>
- <td><div align=\"left\">" . $stats['crimes']['total'] .
- "</div></td>
- </tr>
- </table>
- <br>
- <em>*Caught/Foot are included in failed </em></td>
- </tr>
- </table>
- <th width=\"32%\"><table class=thinline width=\"262\" border=\"0\" align=\"center\">
- <tr>
- <td width=\"262\" height=\"12\" class=tableheader><div align=\"center\">Car Nicks </div></td>
- </tr>
- <tr>
- <td><table width=\"95%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">
- <tr>
- <td width=\"37%\"><div align=\"center\"><strong>Successful</strong></div></td>
- <td width=\"63%\"><div align=\"left\">" . $stats['nick']['successful'] .
- "</div></td>
- </tr>
- <tr>
- <td><div align=\"center\"><strong>Failed</strong></div></td>
- <td><div align=\"left\">" . $stats['nick']['failed'] .
- "</div></td>
- </tr>
- <tr>
- <td><div align=\"center\"><strong>Caught</strong></div></td>
- <td><div align=\"left\">" . $stats['nick']['failed'] .
- "</div></td>
- </tr>
- <tr>
- <td><div align=\"center\"><strong>Total</strong></div></td>
- <td><div align=\"left\">" . $stats['nick']['total'] .
- "</div></td>
- </tr>
- </table>
- <br>
- <em>*Caught is included in Failed </em></td>
- </tr>
- </table>
- </tr>
- </table>
- <br>
- Happy Cheating o/ (3nvisi0n)
- </center>
- </body>";
- write2file('../statistics.html', $page);
- }
- function getTimers($res)
- {
- global $vers;
- //playOmerta()
- ///Parse Crime Timer
- $NCA = $vers['text']['Next crime attempt'];
- $NNA = $vers['text']['Next car attempt'];
- $crime = getBetween($res,
- '<td><a href="/BeO/webroot/index.php?module=Crimes"><b>' . $NCA . '</b></a></td>
- ', '<td><a href="/BeO/webroot/index.php?module=Cars"><b>' . $NNA .
- '</b></a></td>');
- if (inStr('var oTimer = new Timer("nc");', $crime)) {
- $crimeT = trim(getBetween($crime, 'var oTimer = new Timer("nc");',
- 'oTimer.setRefresh(false);'));
- $timer['crime'] = getBetween($crimeT, '(', ')');
- } else
- $timer['crime'] = 0;
- //parse nick timer
- $nick = getBetween($res, '<td><a href="/BeO/webroot/index.php?module=Cars"><b>' .
- $NNA . '</b></a></td>',
- '<td><a href="/BeO/webroot/index.php?module=GroupCrimes"><b>' . $vers['text']['Next heist'] .
- '</b></a></td>');
- if (inStr('var oTimer = new Timer("nca");', $nick)) {
- $nickT = getBetween($nick, 'var oTimer = new Timer("nca");',
- 'oTimer.setRefresh(false);');
- $timer['nick'] = getBetween($nickT, '(', ')');
- } else
- $timer['nick'] = 0;
- //parse flight timer
- $flight = getBetween($res, '<b>' . $vers['text']['Next flight'] .
- '</b></a></td>', '<b>' . $vers['text']['Next bullet deal'] . '</b>');
- if (inStr('var oTimer = new Timer("nf");', $flight)) {
- $flightT = getBetween($flight, 'var oTimer = new Timer("nf");',
- 'oTimer.setRefresh(false);');
- $timer['flight'] = getBetween($flightT, '(', ')');
- } else
- $timer['flight'] = 0;
- return $timer;
- } //getTimers
- function voteForBullets()
- {
- $omerta['info'] = $GLOBALS['vers']['omertaURL_NS'] . '/info.php';
- $omerta['vote'] = $GLOBALS['vers']['omertaURL_NS'] . '/vfo.php';
- $res = get($omerta['vote'], $omerta['info']);
- $res = removeBetween('<--', '-->', $res);
- $res = removeBetween('<!--', '-->', $res);
- if (substr_count($res, '<a href="votelot.php?vf=') == 0) {
- output("Link to vote on got changed", "Voting");
- write2file('vote.html', $res);
- sleep(18);
- die();
- }
- $test = findinside('<a href="votelot.php?vf=', '" target="_blank">', $res);
- output('Time to vote :)', 'Voting');
- for ($i = 1; $i <= (count($test) - 1); $i++)
- $ret = get($GLOBALS['vers']['omertaURL_NS'] . '/votelot.php?vf=' . trim($test[$i]),
- $omerta['vote']);
- output('Finished :)', 'Voting');
- write2file('lv.txt', time());
- } // voteForBullets();
- function buyGun()
- {
- global $omerta, $vers;
- $done = false;
- while (!$done) {
- $res = get($omerta['shop'], $omerta['menu']);
- if (inStr($vers['text']['You have a weapon'], $res)) {
- if (!inStr('Tommy Gun Assault Rifle</td><td>$32,400</td><td><form', $res)) {
- output("Opps, you have a weapon already, but its not a tommy, so we are upgrading you",
- "Shop");
- $post = "sell=weapon&action=Sell";
- $res = post($omerta['shop'], $omerta['shop'], $post);
- } else
- $done = true;
- } else {
- $post = "weapon=7";
- $res = post($omerta['shop'], $omerta['shop'], $post);
- $done = true;
- }
- }
- }
- function checkVote()
- {
- $lastVote = @file_get_contents('lv.txt');
- //output($lastVote, time());
- if (time() >= ($lastVote + (24 * 60 * 60))) {
- voteForBullets();
- }
- }
- function createUserPassFile()
- {
- @unlink('user_pass.txt');
- output("Creating omerta user file");
- echo "Omerta username :: ";
- $oUser = trim(clearParse(fread(STDIN, 1024)));
- echo "Omerta password :: ";
- $oPass = trim(clearParse(fread(STDIN, 1024)));
- write2file('user_pass.txt', $oUser . ':' . $oPass);
- output("File created, restarting. . .");
- die();
- }
- function doRange($cash, $post)
- {
- global $settings, $omerta, $vers;
- //Verify initial start page
- $res = get($omerta['range'], $omerta['menu']);
- if (inStr($vers['text']['Come back in'], $res)) {
- output("To Early. . .", "Range");
- return false;
- }
- if (inStr("src=/static/images/game/generic/criminal.jpg", $res)) {
- iaminjail();
- output("In Jail. . .", "Range");
- doSelfBust($res);
- return false;
- }
- $check[] = "document.rangeForm.submit();";
- $check[] = "<form name=rangeForm method=POST>";
- $check[] = "<input type=hidden name=stage value=enter>";
- $check[] = "<input type=image src=/static/images/game/shootingrange/shootscircle.png width=75px hieght=75px>";
- $res2 = str_replace("'", '', $res);
- $res2 = str_replace('"', '', $res2);
- if (!inStrArray($check, $res2)) {
- output("Enter range page changed", "Range");
- return false;
- } //if
- if (substr_count(strtolower($res), '<form') != 1) {
- output('<form count on range enter page failed (' . substr_count(strtolower($res),
- '<form') . ')', 'Range');
- return false;
- }
- if (substr_count(strtolower($res), '<input') != 2) {
- output('<input count on range enter page failed (' . substr_count(strtolower($res),
- '<input') . ')', 'Range');
- return false;
- }
- $payment = str_replace(',', '', getBetween($res, 'owe me $', ', ' . $vers['text']['now']));
- if ($payment > $cash || $payment > $settings['maxRangeCost']) {
- output("Range is too expensive (\$ $payment)", "Range");
- return false;
- } //fi
- $res = post($omerta['range'], $omerta['range'], $post[0]);
- $check = array();
- $check[] = "document.rangeForm.submit();";
- $check[] = "<form name=rangeForm method=POST><input type=hidden name=stage value=select><input type=hidden name=target value=low><input type=image src=/static/images/game/shootingrange/target3.jpg></form>";
- $check[] = "<form name=rangeForm method=POST><input type=hidden name=stage value=select><input type=hidden name=target value=mid><input type=image src=/static/images/game/shootingrange/target2.jpg></form>";
- $check[] = "<form name=rangeForm method=POST><input type=hidden name=stage value=select><input type=hidden name=target value=high><input type=image src=/static/images/game/shootingrange/target1.jpg></form>";
- $res2 = str_replace("'", '', $res);
- $res2 = str_replace('"', '', $res2);
- if (!inStrArray($check, $res2)) {
- write2file('targetRange_change.html', $res2);
- output("target range page changed", "Range");
- return false;
- } //if
- if (substr_count(strtolower($res), '<form') != 3) {
- output('<form count on range target select page failed (' . substr_count(strtolower
- ($res), '<form') . ')', 'Range');
- return false;
- }
- if (substr_count(strtolower($res), '<input') != 9) {
- output('<input count on range target select page failed (' . substr_count(strtolower
- ($res), '<input') . ')', 'Range');
- return false;
- }
- $res = post($omerta['range'], $omerta['range'], $post[1]);
- parse_str($post[1], $parse);
- $tv = "";
- switch ($parse['target']) {
- case 'high':
- $tv = 1;
- break;
- case 'mid':
- $tv = 2;
- break;
- case 'low':
- $tv = 3;
- break;
- default:
- output("Shooting rage post[1] messed up, target= not valid", 'Range');
- break;
- }
- $check = array();
- $check[] = "document.rangeForm.submit();";
- $check[] = "<form name=rangeForm method=POST><input name=stage value=shoot><input name=target value=$tv><input name=sub value=1><input type=image src=/static/images/game/shootingrange/shootscircle.png width=75px hieght=75px>";
- $check[] = "<form name=rangeForm method=POST><input name=stage value=shoot><input name=target value=$tv><input name=sub value=2><input type=image src=/static/images/game/shootingrange/shootscircle.png width=75px hieght=75px>";
- $res2 = str_replace("'", '', $res);
- $res2 = str_replace('"', '', $res2);
- $res2 = str_replace(' type=hidden', '', $res2);
- if (!inStrArray($check, $res2)) {
- write2file('subRange_change.html', $res2);
- output("Sub select range page changed", "Range");
- return false;
- } //if
- if (substr_count(strtolower($res), '<form') != 2) {
- output('<form count on range enter page failed (' . substr_count(strtolower($res),
- '<form') . ')', 'Range');
- return false;
- }
- if (substr_count(strtolower($res), '<input') != 8) {
- output('<input count on range enter page failed (' . substr_count(strtolower($res),
- '<input') . ')', 'Range');
- return false;
- }
- $res = post($omerta['range'], $omerta['range'], $post[2]);
- if (!inStr($vers['text']['Kill Skill'], $res)) {
- output("hmm, result page changed", 'Range');
- return false;
- }
- $gain = getBetween($res, $vers['text']['You have gained'], $vers['text']['Kill Skill']);
- output("Your kill skill increased $gain", "Range");
- return true;
- }
- function logoutOmerta()
- {
- global $settings, $omerta;
- $res = get($GLOBALS['vers']['omertaURL_NS'] . "/game-login.php?logout=yes", $GLOBALS['vers']['omertaURL_NS'] .
- "");
- $checkArray = array('<title>Omerta',
- '<form method="post" action="game-login.php">');
- if (inStrArray($checkArray, $res)) {
- output("Logout succeeded", "Sleeping");
- return;
- } else {
- output("Logout went wrong (stopping script)", "Sleeping");
- die();
- }
- }
- function sleeping()
- {
- global $omerta, $settings, $scriptSite, $startSleep;
- if (($startSleep < time()) && ($startSleep > 6000)) {
- $sleeptime = time() + ($settings['sleepingT'] * 60);
- $datesleep = date("d/m G:i:s", $sleeptime);
- output("Sleeping until $datesleep", "Sleeping");
- logoutOmerta();
- $remainingsleep = $settings['sleepingT'] * 60;
- while ($sleeptime > time()) {
- sleep(60);
- $remainingsleep = $remainingsleep - 60;
- output("Sleeping, will start ranking again in $remainingsleep seconds ($datesleep)",
- "Sleeping");
- }
- if ($sleeptime < time()) {
- output("Goodmorning beauty, lets login and rank again \o/", "Sleeping");
- }
- #Get a new sleeptime
- $year = date("Y", time());
- $day = date("j", time()) + 1;
- $month = date("m", time());
- $startSleep = mktime($settings['sleepingH'], $settings['sleepingM'], 0, $month,
- $day, $year);
- login2Omerta();
- }
- }
- function parsePages()
- {
- global $omerta, $vers;
- $omertaURL = $vers['omertaURL'];
- $res = get($omertaURL . "menu.php", $omertaURL . "index.php");
- $exp = explode("<tr><td><a class=\"menuLink\" ", $res);
- $links = array();
- foreach ($exp as $link) {
- if ($link{0} = 'h') {
- $links[strtolower(trim(getBetween($link, '>', '</a>')))] = trim(getBetween($link,
- 'href="', '"'));
- $links[strtolower(trim(getBetween($link, '>', '</a>')))] = str_replace('./', $omertaURL,
- $links[strtolower(trim(getBetween($link, '>', '</a>')))]);
- }
- }
- foreach ($vers['links'] as $key => $val) {
- $omerta[$key] = $links[$val];
- }
- $omerta['menu'] = $omertaURL . "menu.php";
- $checkArray = array('function logout() {',
- 'if(confirm("Are you sure you want to log out?")) parent.top.location.href = \'./game-login.php?logout=yes\';');
- if (!inStrArray($checkArray, $res)) {
- write2file("logoutMD5.txt", md5($res) . "\r\n" . $res);
- output("Menu.php (logout) changed", "Login");
- sleep(10);
- die();
- }
- }
- function setVersion($version)
- {
- global $vers;
- switch (strtolower($version)) {
- //to add a version just chage values :)
- case "dm":
- $vers['version'] = 'dm';
- $vers['omertaURL'] = "http://dm.barafranca.com/";
- $vers['omertaURL_NS'] = "http://dm.barafranca.com"; //no slash
- //Text
- $vers['links']['crimes'] = "crimes";
- $vers['links']['carNick'] = "nick a car";
- $vers['links']['status'] = "status";
- $vers['links']['smuggling'] = "smuggling";
- $vers['links']['inbox'] = "inbox";
- $vers['links']['travel'] = "travel";
- $vers['links']['jail'] = "jail";
- $vers['links']['blood'] = "bloodbank";
- $vers['links']['bullets'] = "bullets";
- $vers['links']['shop'] = "shop/market";
- $vers['links']['gamble'] = "gambling district";
- $vers['links']['range'] = "shooting range";
- //buyBooze
- $vers['text']['hold'] = "hold "; //From booze/narcs "hold ## units" requires space at end
- $vers['text']['units of booze'] = ' units of booze'; //requires beginning space
- $vers['text']['beer'] = "Beer";
- $vers['text']['You only have the ability'] =
- 'You only have the ability'; //Error Message to buying too much b/n
- $vers['text']['Jail'] = "Jail";
- $vers['text']['The code you'] = "The code you"; //Wrong Coode booze error message
- //bloodbuy
- $vers['text']["You don't have enough"] = "You don't have enough";
- //Booze/Blood not enuf cash err message
- $vers['text']['You are in jail for the next'] = 'You are in jail for the next'; //In jail msg
- $vers['text']['Sorry, you can only buy blood once every 45 minutes.'] =
- 'Sorry, you can only buy blood once every 45 minutes.'; //Blood early error msg
- $vers['text']['bought'] = 'bought'; //blood
- //buyBullets
- $vers['text']["You've got"] = "You've got $"; //bullet page
- $vers['text']['in your pocket'] = ' in your pocket'; //requires beginning space
- $vers['text']["You don't have"] = "You don't have";
- $vers['text']['This factory does'] = "This factory does"; //Factory outta bullets after purchase attempt
- $vers['text']['The price per bullet just'] = 'The price per bullet just';
- $vers['text']['Success, you bought '] = 'Success, you bought '; //requires end space
- $vers['text']['The code you verified'] = 'The code you verified'; //Bullet wrong code err msg
- //buyCocaine
- $vers['text']['units of narcotics'] = ' units of narcotics'; //requires beginning space
- $vers['text']['Cocaine'] = "Cocaine";
- //buyGun
- $vers['text']['You have a weapon'] = 'You have a weapon';
- //carNick
- $vers['text']['tired'] = "tired"; //Too early error msg
- //checkGambling
- $vers['text']['Gambling District'] = "Gambling District";
- //checkRoul
- $vers['text']['even'] = "Even";
- $vers['text']['red'] = "Red";
- $vers['text']['black'] = "Black";
- $vers['text']['odd'] = "Odd";
- $vers['text']['Gamble'] = "Gamble";
- //clicklimitCheck
- $vers['text']['clicklimit'] = "clicklimit."; //requires period '.'
- //crime
- $vers['text']['made'] = 'made';
- $vers['text']['done'] = 'done'; //From Well done! on successful bottle
- $vers['text']['foot'] = 'foot'; //Shot foot
- //doBust
- $vers['text']["You are not"] = "You are not"; //You are not in jail, during busting
- $vers['text']["freed"] = "freed"; //on already busted person
- $vers['text']["You busted"] = "You busted"; //on successful jail bust
- //doRange
- $vers['text']['Come back in'] = 'Come back in'; //Too early for range msg
- $vers['text']['owe me'] = 'owe me $';
- $vers['text']['Kill Skill'] = 'Kill Skill'; //on successful shoot
- $vers['text']['You have gained'] = 'You have gained '; //ending space necessary
- //doSelfBust
- $vers['text']['Click here to buy yourself out for $ '] =
- 'Click here to buy yourself out for $ '; //end space neessary
- $vers['text']['Try it'] = 'Try it'; //from injail page
- //gambleRoul
- $vers['text']['Maximum Bet on numbers'] = 'Maximum Bet on numbers:'; //roulette page
- $vers['text']['got enough cash to do this'] = 'got enough cash to do this'; //Not enuf cash
- $vers['text']['You can only gamble for'] = 'You can only gamble for'; //max bet
- //getBulletAmmount
- $vers['text']['There are'] = 'There are ';
- //There are ## bullets in factory, end space required
- //getTimers (status page)
- $vers['text']['Next crime attempt'] = 'Next crime attempt';
- $vers['text']['Next car attempt'] = 'Next car attempt';
- $vers['text']['Next heist'] = 'Next heist';
- $vers['text']['Next flight'] = 'Next flight';
- $vers['text']['Next bullet deal'] = 'Next bullet deal';
- //getinbox
- $vers['text']['Bustout'] = 'Bustout!'; //exclaimation point '!' required
- $vers['text']['Bailed'] = 'Bailed!'; //exclaimation point '!' required
- //parseHealth (Status page)
- $vers['text']['Rank progress'] = 'Rank progress';
- $vers['text']['Killing skill'] = 'Killing skill';
- //parseNickResults
- $vers['text']['Success'] = 'Success: you stole a';
- $vers['text']['with'] = 'with'; //with %% damage
- $vers['text']['worth'] = 'worth'; //worth $ ##,###
- //parseStatus
- $vers['text']['now'] = 'now'; //lowercase
- $vers['text']['Now'] = 'Now'; //proper case
- $vers['text']['gress'] = 'gress'; //last part of the word progress in 'rank progress'
- $vers['text']['health'] = 'health'; //must be lowercase
- $vers['text']['rank'] = 'rank'; //must be lowercase
- $vers['text']['Cash'] = 'Cash';
- $vers['text']['Jailbusting Skill'] = 'Jailbusting Skill';
- $vers['text']['Family'] = 'Family';
- $vers['text']['Capo'] = 'Capo';
- $vers['text']['Level'] = 'Level'; //From user level ie. Donater
- $vers['text']['Start'] = 'Start'; //From start date
- $vers['text']['Plane'] = 'Plane';
- $vers['text']['None'] = 'None';
- $vers['text']['Nextflight'] = 'Nextflight'; //No space
- $vers['text']['Booze'] = 'Booze'; //replybo
- $vers['text']['Delete'] = "Delete"; //this is an alttext viewable in page source
- $vers['text']['Message'] = 'Message';
- //sellBooze
- $vers['text']['Wine'] = 'Wine';
- $vers['text']['Cognac'] = 'Cognac';
- $vers['text']['Whiskey'] = 'Whiskey';
- $vers['text']['Amaretto'] = 'Amaretto';
- $vers['text']['Beer'] = 'Beer';
- $vers['text']['Port'] = 'Port';
- $vers['text']['Rum'] = 'Rum';
- //sellStuff
- $vers['text']['Morphine'] = 'Morphine';
- $vers['text']['Heroin'] = 'Heroin';
- $vers['text']['Opium'] = 'Opium';
- $vers['text']['Marihuana'] = 'Marihuana';
- $vers['text']['Tabacco'] = 'Tabacco';
- $vers['text']['Glue'] = 'Glue';
- //stillLoggedIn
- $vers['text']['loginCheck'] =
- "Omerta is a text-based massive multiplayer RPG game, based on the stories about the legendary don Barafranca";
- //Above is some text from the login page
- //verifyReplyBo (Send Message Page)
- $vers['text']['Send'] = 'Send'; //button text
- break;
- case "com":
- $vers['version'] = 'com';
- $vers['omertaURL'] = "http://www.barafranca.com/";
- $vers['omertaURL_NS'] = "http://www.barafranca.com"; //no slash
- //Text
- $vers['links']['crimes'] = "crimes";
- $vers['links']['carNick'] = "nick a car";
- $vers['links']['status'] = "status";
- $vers['links']['smuggling'] = "smuggling";
- $vers['links']['inbox'] = "inbox";
- $vers['links']['travel'] = "travel";
- $vers['links']['jail'] = "jail";
- $vers['links']['blood'] = "bloodbank";
- $vers['links']['bullets'] = "bullets";
- $vers['links']['shop'] = "shop/market";
- $vers['links']['gamble'] = "gambling district";
- $vers['links']['range'] = "shooting range";
- //buyBooze
- $vers['text']['hold'] = "hold "; //From booze/narcs "hold ## units" requires space at end
- $vers['text']['units of booze'] = ' units of booze'; //requires beginning space
- $vers['text']['beer'] = "Beer";
- $vers['text']['You only have the ability'] =
- 'You only have the ability'; //Error Message to buying too much b/n
- $vers['text']['Jail'] = "Jail";
- $vers['text']['The code you'] = "The code you"; //Wrong Coode booze error message
- //bloodbuy
- $vers['text']["You don't have enough"] = "You don't have enough";
- //Booze/Blood not enuf cash err message
- $vers['text']['You are in jail for the next'] = 'You are in jail for the next'; //In jail msg
- $vers['text']['Sorry, you can only buy blood once every 45 minutes.'] =
- 'Sorry, you can only buy blood once every 45 minutes.'; //Blood early error msg
- $vers['text']['bought'] = 'bought'; //blood
- //buyBullets
- $vers['text']["You've got"] = "You've got $"; //bullet page
- $vers['text']['in your pocket'] = ' in your pocket'; //requires beginning space
- $vers['text']["You don't have"] = "You don't have";
- $vers['text']['This factory does'] = "This factory does"; //Factory outta bullets after purchase attempt
- $vers['text']['The price per bullet just'] = 'The price per bullet just';
- $vers['text']['Success, you bought '] = 'Success, you bought '; //requires end space
- $vers['text']['The code you verified'] = 'The code you verified'; //Bullet wrong code err msg
- //buyCocaine
- $vers['text']['units of narcotics'] = ' units of narcotics'; //requires beginning space
- $vers['text']['Cocaine'] = "Cocaine";
- //buyGun
- $vers['text']['You have a weapon'] = 'You have a weapon';
- //carNick
- $vers['text']['tired'] = "tired"; //Too early error msg
- //checkGambling
- $vers['text']['Gambling District'] = "Gambling District";
- //checkRoul
- $vers['text']['even'] = "Even";
- $vers['text']['red'] = "Red";
- $vers['text']['black'] = "Black";
- $vers['text']['odd'] = "Odd";
- $vers['text']['Gamble'] = "Gamble";
- //clicklimitCheck
- $vers['text']['clicklimit'] = "clicklimit."; //requires period '.'
- //crime
- $vers['text']['made'] = 'made';
- $vers['text']['done'] = 'done'; //From Well done! on successful bottle
- $vers['text']['foot'] = 'foot'; //Shot foot
- //doBust
- $vers['text']["You are not"] = "You are not"; //You are not in jail, during busting
- $vers['text']["freed"] = "freed"; //on already busted person
- $vers['text']["You busted"] = "You busted"; //on successful jail bust
- //doRange
- $vers['text']['Come back in'] = 'Come back in'; //Too early for range msg
- $vers['text']['owe me'] = 'owe me $';
- $vers['text']['Kill Skill'] = 'Kill Skill'; //on successful shoot
- $vers['text']['You have gained'] = 'You have gained '; //ending space necessary
- //doSelfBust
- $vers['text']['Click here to buy yourself out for $ '] =
- 'Click here to buy yourself out for $ '; //end space neessary
- $vers['text']['Try it'] = 'Try it'; //from injail page
- //gambleRoul
- $vers['text']['Maximum Bet on numbers'] = 'Maximum Bet on numbers:'; //roulette page
- $vers['text']['got enough cash to do this'] = 'got enough cash to do this'; //Not enuf cash
- $vers['text']['You can only gamble for'] = 'You can only gamble for'; //max bet
- //getBulletAmmount
- $vers['text']['There are'] = 'There are ';
- //There are ## bullets in factory, end space required
- //getTimers (status page)
- $vers['text']['Next crime attempt'] = 'Next crime attempt';
- $vers['text']['Next car attempt'] = 'Next car attempt';
- $vers['text']['Next heist'] = 'Next heist';
- $vers['text']['Next flight'] = 'Next flight';
- $vers['text']['Next bullet deal'] = 'Next bullet deal';
- //getinbox
- $vers['text']['Bustout'] = 'Bustout!'; //exclaimation point '!' required
- $vers['text']['Bailed'] = 'Bailed!'; //exclaimation point '!' required
- //parseHealth (Status page)
- $vers['text']['Rank progress'] = 'Rank progress';
- $vers['text']['Killing skill'] = 'Killing skill';
- //parseNickResults
- $vers['text']['Success'] = 'Success: you stole a';
- $vers['text']['with'] = 'with'; //with %% damage
- $vers['text']['worth'] = 'worth'; //worth $ ##,###
- //parseStatus
- $vers['text']['now'] = 'now'; //lowercase
- $vers['text']['Now'] = 'Now'; //proper case
- $vers['text']['gress'] = 'gress'; //last part of the word progress in 'rank progress'
- $vers['text']['health'] = 'health'; //must be lowercase
- $vers['text']['rank'] = 'rank'; //must be lowercase
- $vers['text']['Cash'] = 'Cash';
- $vers['text']['Jailbusting Skill'] = 'Jailbusting Skill';
- $vers['text']['Family'] = 'Family';
- $vers['text']['Capo'] = 'Capo';
- $vers['text']['Level'] = 'Level'; //From user level ie. Donater
- $vers['text']['Start'] = 'Start'; //From start date
- $vers['text']['Plane'] = 'Plane';
- $vers['text']['None'] = 'None';
- $vers['text']['Nextflight'] = 'Nextflight'; //No space
- $vers['text']['Booze'] = 'Booze'; //replybo
- $vers['text']['Delete'] = "Delete"; //this is an alttext viewable in page source
- $vers['text']['Message'] = 'Message';
- //sellBooze
- $vers['text']['Wine'] = 'Wine';
- $vers['text']['Cognac'] = 'Cognac';
- $vers['text']['Whiskey'] = 'Whiskey';
- $vers['text']['Amaretto'] = 'Amaretto';
- $vers['text']['Beer'] = 'Beer';
- $vers['text']['Port'] = 'Port';
- $vers['text']['Rum'] = 'Rum';
- //sellStuff
- $vers['text']['Morphine'] = 'Morphine';
- $vers['text']['Heroin'] = 'Heroin';
- $vers['text']['Opium'] = 'Opium';
- $vers['text']['Marihuana'] = 'Marihuana';
- $vers['text']['Tabacco'] = 'Tabacco';
- $vers['text']['Glue'] = 'Glue';
- //stillLoggedIn
- $vers['text']['loginCheck'] =
- "Omerta is a text-based massive multiplayer RPG game, based on the stories about the legendary don Barafranca";
- //Above is some text from the login page
- //verifyReplyBo (Send Message Page)
- $vers['text']['Send'] = 'Send'; //button text
- break;
- default:
- output("Unknown version $version", "error");
- break;
- }
- }
- function forceCookies() {
- global $curl, $vers, $settings;
- curl_close($curl);
- $curl = curl_init();
- $cont = str_replace('# Netscape HTTP Cookie File
- # http://curlm.haxx.se/rfc/cookie_spec.html
- # This file was generated by libcurl! Edit at your own risk.
- ','',file_get_contents('cookies.txt'));
- $ck = array();
- $cookies = explode("\n",$cont);
- foreach($cookies as $cook){
- //output($cook);
- $values=explode(" ", $cook);
- $count = count($values);
- if($values[0]==str_replace('http://','',$vers['omertaURL_NS'])) {
- $ck[$values[$count-2]] = $values[$count-1];
- }
- }
- write2file('phpsess.txt',$vers['omertaURL_NS'].'`'.$ck['PHPSESSID']);
- }
- ?>
Add Comment
Please, Sign In to add comment