Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts

    Inserting anti auto clicker lines

    I have a script to block auto clickers on my buttons and I can't figure out how to put it in. I keep trying and when the page stops having blank page errors. It says a cookie problem. Anyway here is the script I want to put in,

    Code:
    <?php
    // anti clicker routine
    ?>
      <style>
      .buttons {
          padding-right: 0pt;
           padding-left: 0pt;
              font-size: 10pt;
         padding-bottom: 0pt;
                  color: hotpink;
            padding-top: 0pt;
            font-family: verdana, geneva, arial, helvetica, sans-serif;
                spacing: 50pt;
                height: 15pt;
                width:  80pt
      }
      </style>
    <?php
    $a = rand(1,100);
    if ($a<=50)
    	{
    	$b1="ClickMe";
    	$b2="DontClickMe";
    	}
    else
    	{
    	$b2="ClickMe";
    	$b1="DontClickMe";
    	}
    echo "<input type='button' value=$b1 width='200' class='buttons'>";
    echo "<input type='button' value=$b2 width='200' class='buttons'>";
    
    ?>
    Which you have to set everything, and here is part of my script, where this will be. I use $page .= "text"; for displaying rather then echo.

    I want it to display 2 buttons, and a 50-50 chance of swapping the places of the buttons. So one is a fake button and one is the working one.

    Code:
     // Smelting
        $title = 'Smelting';
        
        if(!isset($smeltid)){
        
        $page = 'You must specify a Bar to smelt. Please return to <a href=index.php>town</a> and try again.';
        
       } else {
          global $script;
          $script="hide('smelting');";
    
    
    	  if(!array_key_exists("smelting",$_GET)){ 
    		setcookie ("dkgame-counter", "0", $expiretime, "", "", 0);
    		 
                   
                   
                   $page="<table width='100%' border='1'><tr><td class='title'>Back to <a href=\"skills.php?do=smelting\">Furnace</a></td><td class='title'><center>Smelting</center></td><td class='title'>Go to <a href=\"index.php\">Town</a></td></tr></table><p>";
                   $page = $page . '<center><font color=blue>You begin to place your Ores into the hot furnace.</font>';
                   $page = $page . '<br><br>';
                   $page = $page . '<div id="display"></div></center>';
    			   //$page.= "<center><form action='$PHP_SELF'><input type='hidden' name='smeltid' value='$smeltid'><input type='submit' id='smelting' name='smelting' value='Start Smelting'><input type='hidden' id='counter' name='counter' value='0'></form></center>";
    			   $page.="
    <center><div style='color: red; text-align: center' id='smeltingdiv'>Smelting button load delayed to prevent Power Clicking and reduce Server Load.</div><div id='mining'  style='visibility: hidden'><div id='smelting'>
    <form action='$PHP_SELF'> 
    <input type='hidden' name='smeltid' id='smeltid' value='$smeltid'><input type='submit' id='smelting' name='smelting' value='Start smelting' onclick=\"carrot2('smelting');\"><input type='hidden' id='counter' name='counter' value='0'></form><div></center>";
    	  }else{
    		 $counter=$_GET["counter"];
    		 $test=$_COOKIE["dkgame-counter"];		
    		 $counter++;
    		 $test++;
    		 if($test!==$counter){
    			setcookie ("dkgame-counter", "-1", $expiretime, "", "", 0);
    			die('You have refreshed. Please remember to use the appropriate button. Refreshing is not permitted.<br><br>If you feel this is an error, try clearing out your browsers cookies.<br><br>To continue click <a href="skills.php?do=smelting">here</a>');
    		 }
    		 $expiretime = time()+31536000;
    		 setcookie ("dkgame-counter", $test, $expiretime, "", "", 0);
    
    
             $smeltquery = doquery("SELECT * FROM {{table}} WHERE id='".$smeltid."'", "smelting");
             
             if(mysql_num_rows($smeltquery) != 1) { 
             	die("Cheat attempt sent to administrator."); 
             }
    
             $smeltrow = mysql_fetch_array($smeltquery);
             $smeltxp = $smeltrow["level"] * 3 + 317;
             $smelting = $userrow["smelting"];
             $levelup = $userrow["smelting"] +1;
             $smeltingxp = $userrow["smeltingxp"];
             $tolevel = $smelting * 565 * $smelting + (($userrow["smelting"] * 25)* $smelting);
             $xptolevel = $smeltingxp + $smeltxp;
             $fatlimit = $userrow["currentfat"];
             $fatlimit = $fatlimit + 5; 
             if($fatlimit <= $userrow["maxfat"]){
                if($userrow["smelting"] > $smeltrow["level"] || $userrow["smelting"] == $smeltrow["level"]){
                 
                 
                  if(($userrow["ore1"] >= $smeltrow["ore1"]) AND ($userrow["ore2"] >= $smeltrow["ore2"]) AND ($userrow["ore3"] >= $smeltrow["ore3"]) AND ($userrow["ore4"] >= $smeltrow["ore4"]) AND ($userrow["ore5"] >= $smeltrow["ore5"]) AND ($userrow["ore6"] >= $smeltrow["ore6"]) AND ($userrow["ore7"] >= $smeltrow["ore7"]) AND ($userrow["ore8"] >= $smeltrow["ore8"]) AND ($userrow["ore9"] >= $smeltrow["ore9"]) AND ($userrow["ore10"] >= $smeltrow["ore10"]) AND ($userrow["ore11"] >= $smeltrow["ore11"]) AND ($userrow["ore12"] >= $smeltrow["ore12"]) AND ($userrow["ore13"] >= $smeltrow["ore13"])){
                // if(($userrow["ore1"] > $smeltrow["ore1"]) AND ($userrow["ore2"] > $smeltrow["ore2"])){  
           
                   $page = '<center>';
                   $page = "<table width='100%' border='1'><tr><td class='title'>Back to <a href=\"skills.php?do=smelting\">Furnace</a></td><td class='title'><center>Smelting</center></td><td class='title'>Go to <a href=\"index.php\">Town</a></td></tr></table><p>";
                   $page = $page . '<center>You place your Ores into the furnace and Smelt 1 '.$smeltrow["name"].'!';
                   $page = $page . '<br><br>';
                   $page = $page . '<font color=green>You gain '.$smeltxp.' Smelting experience points.</font>';
                   $page = $page . '<br><br>';
                   $page = $page . '<div id="display"></div>';
                    $page.="
    <center><div style='color: red; text-align: center' id='smeltingdiv'>Smelting button load delayed to prevent Power Clicking and reduce Server Load.</div><div id='mining'  style='visibility: hidden'><div id='smelting'>
    <form action='$PHP_SELF'> 
    <input type='hidden' name='smeltid' id='smeltid' value='$smeltid'><input type='submit' id='smelting' name='smelting' value='Smelt some more' onclick=\"carrot2('smelting');\"><input type='hidden' id='counter' name='counter' value='$counter'></form><div></center>";
                    
                   $query = doquery("UPDATE {{table}} SET ore1=ore1-'".$smeltrow["ore1"]."', ore2=ore2-'".$smeltrow["ore2"]."', ore3=ore3-'".$smeltrow["ore3"]."', ore4=ore4-'".$smeltrow["ore4"]."', ore5=ore5-'".$smeltrow["ore5"]."', ore6=ore6-'".$smeltrow["ore6"]."', ore7=ore7-'".$smeltrow["ore7"]."', ore8=ore8-'".$smeltrow["ore8"]."', ore9=ore9-'".$smeltrow["ore9"]."', ore10=ore10-'".$smeltrow["ore10"]."', ore11=ore11-'".$smeltrow["ore11"]."', ore12=ore12-'".$smeltrow["ore12"]."', ore13=ore13-'".$smeltrow["ore13"]."', currentfat=currentfat+5, smeltingxp=smeltingxp+'".$smeltxp."', bar".$smeltid."=bar".$smeltid."+'1' WHERE id='".$userrow["id"]."' LIMIT 1", "users");

  • #2
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    *bump*

  • #3
    Regular Coder
    Join Date
    Oct 2005
    Location
    Surrey, England
    Posts
    286
    Thanks
    2
    Thanked 2 Times in 2 Posts
    i used the first code in a standalone file and it worked perfectly...

    i have no idea what the second is for and you have given no database structure so its all guess work as to if there may be a problem with the second script.
    Daniel Warner
    - - - - - - - - - -
    GuitarMart.co.uk - Free Online Classified Advertisement for Guitarists in the United Kingdom. Free Ads with a Free Photo.

  • #4
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    What's an anti-auto-clicker script?

    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #5
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    Please no spamming

    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #6
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    The first coding is the anti autoclicker script. The first part is CSS where it will switch the buttons.
    Then it has a 50-50 chance of changing the buttons.

    The second coding is part of my script on my website. I need to figure a way to insert that above code into the button code, where the button part is.


  •  

    Posting Permissions

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