Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 02-12-2017, 01:11 PM
Silver_Brick Silver_Brick is offline
Designer || Coder
 
Join Date: Oct 2016
Location: In Earth
Posts: 205
Gender: Male
Credits: 26,992
Silver_Brick is on a distinguished road
Default Random Adoption Process ?

I want to do random adoption process so 4 random egg will appear horizontally and user can click them to adopt them and there will be no submit button or naming option and they have chances to adopt rare egg very less...
Reply With Quote
  #2  
Old 02-13-2017, 12:13 PM
kristhasirah's Avatar
kristhasirah kristhasirah is offline
Member
 
Join Date: Jan 2010
Location: In middle of the nothingness
Posts: 196
Gender: Female
Credits: 28,403
kristhasirah
Default

there's an old thread here with a code doing what you want, but you will need to edit it so it can work with the new script:
http://mysidiaadoptables.com/forum/s...ead.php?t=3527

I manage to make it work, so is not that hard ^^ you just need to add a new row in the database in the adopt_adoptables called rarity and made the changes to the code so it can appear

PHP Code:
   $adoptform "<form name='form1' method='post' action='$adopt'><table id='adoptdark' name='adopt' class='adopt'>";
    
$common 0
    
$uncommon rand(1,50);   
    
$rare rand(1,100);   
    
$ultrarare rand(1,200);
    
$legendary rand(1,300);   

    if (
$uncommon==&& $onlyone==0){   
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='1' ORDER BY RAND() LIMIT 1"
$onlyone 1;   
    }   
    else if (
$rare==&& $onlyone==0){   
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='2' ORDER BY RAND() LIMIT 1"
$onlyone 1;   
    }       
    else if (
$ultrarare==1  && $onlyone==0){   
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='3' ORDER BY RAND() LIMIT 1"
$onlyone 1;   
    }  
    else if (
$legendary==1  && $onlyone==0){   
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='4' ORDER BY RAND() LIMIT 1"
$onlyone 1;   
    }     
    else{   
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='0' ORDER BY RAND() LIMIT 1";   
    }   
    
$stmt $mysidia->db->query($query);  
    
        while(
$row $stmt->fetchObject()) {

            
$adoptform .= "<td width='25%' VALIGN='center'><div align=center><img src='http://127.0.0.1/pokeupdate/picuploads/unknownegg.png' /></div></a><br><div align=center><input type='radio' name='id' id='id' value='{$row->id}' /></div><div align=center><strong>{$row->description}</strong></td>";
        
        }
    
    
    
$common 0
    
$uncommon rand(1,50);   
    
$rare rand(1,100);   
    
$ultrarare rand(1,200);
    
$legendary rand(1,300);   

    if (
$uncommon==&& $onlyone==0){   
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='1' ORDER BY RAND() LIMIT 1"
$onlyone 1;   
    }   
    else if (
$rare==&& $onlyone==0){   
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='2' ORDER BY RAND() LIMIT 1"
$onlyone 1;   
    }       
    else if (
$ultrarare==1  && $onlyone==0){   
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='3' ORDER BY RAND() LIMIT 1"
$onlyone 1;   
    }  
    else if (
$legendary==1  && $onlyone==0){   
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='4' ORDER BY RAND() LIMIT 1"
$onlyone 1;   
    }     
    else{   
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='0' ORDER BY RAND() LIMIT 1";   
    }   
    
$stmt $mysidia->db->query($query);  

    while(
$row $stmt->fetchObject()) {

            
$adoptform2 .= "<td width='25%' VALIGN='center'><div align=center><img src='http://127.0.0.1/pokeupdate/picuploads/unknownegg.png' /></div></a><br><div align=center><input type='radio' name='id' id='id' value='{$row->id}' /></div><div align=center><strong>{$row->description}</strong></div></td>";

            
   } 
   
    
$common 0
    
$uncommon rand(1,50);   
    
$rare rand(1,100);   
    
$ultrarare rand(1,200);
    
$legendary rand(1,300);   

    if (
$uncommon==&& $onlyone==0){   
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='1' ORDER BY RAND() LIMIT 1"
$onlyone 1;   
    }   
    else if (
$rare==&& $onlyone==0){   
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='2' ORDER BY RAND() LIMIT 1"
$onlyone 1;   
    }       
    else if (
$ultrarare==1  && $onlyone==0){   
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='3' ORDER BY RAND() LIMIT 1"
$onlyone 1;   
    }  
    else if (
$legendary==1  && $onlyone==0){   
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='4' ORDER BY RAND() LIMIT 1"
$onlyone 1;   
    }     
    else{   
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='0' ORDER BY RAND() LIMIT 1";   
    }   
    
$stmt $mysidia->db->query($query);  

    while(
$row $stmt->fetchObject()) {

            
$adoptform3 .= "<td width='25%' VALIGN='center'><div align=center><img src='http://127.0.0.1/pokeupdate/picuploads/unknownegg.png' /></div></a><br><div align=center><input type='radio' name='id' id='id' value='{$row->id}' /></div><div align=center><strong>{$row->description}</strong></div></td>";
    }
  
   
        
$document->add(new Comment("{$adoptform}{$adoptform2}{$adoptform3}")); 
probably is not the best way of doing it, but it works for me ^^
I have mine below the lines:
PHP Code:
            $document->addLangvar((!$mysidia->user->isloggedin)?$mysidia->lang->guest:$mysidia->lang->member);          
            
$adoptForm = new Form("form""adopt""post");
            
$adoptTitle = new Comment("Available Adoptables");
            
$adoptTitle->setHeading(3);
            
$adoptForm->add($adoptTitle);
            
$adoptTable = new Table("table"""FALSE); 
and above the lines:
PHP Code:
            $adoptForm->add($adoptTable);        
            
$adoptForm->add(new Button("Adopt Me""submit""submit"));
            
$document->add($adoptForm);
        }
    }
}
?> 
this part of the code:
PHP Code:
$document->add(new Comment("{$adoptform}{$adoptform2}{$adoptform3}")); 
replaces the
PHP Code:
$document->add(new Comment($adoptform)); 
cant post my full adoptview.php file because is very modified.
hope this can be use full for you^^

this code shows 3 eggs at the same time.
__________________
Reply With Quote
  #3  
Old 02-13-2017, 12:42 PM
Silver_Brick Silver_Brick is offline
Designer || Coder
 
Join Date: Oct 2016
Location: In Earth
Posts: 205
Gender: Male
Credits: 26,992
Silver_Brick is on a distinguished road
Default

Thanks for the help :)
Reply With Quote
  #4  
Old 02-19-2017, 11:25 AM
Chaos77777 Chaos77777 is offline
Member
 
Join Date: Jan 2017
Posts: 43
Gender: Male
Credits: 3,728
Chaos77777 is on a distinguished road
Default

Hey guys. I started using this too. But there's a big problem I can't seem to figure out. If someone were to get a really rare adopt, all they would have to do is keep refreshing to get the same one over and over again. Any way around that?
Reply With Quote
  #5  
Old 02-19-2017, 12:06 PM
Silver_Brick Silver_Brick is offline
Designer || Coder
 
Join Date: Oct 2016
Location: In Earth
Posts: 205
Gender: Male
Credits: 26,992
Silver_Brick is on a distinguished road
Default

i thinks its random So it won't happen :)
Reply With Quote
  #6  
Old 02-19-2017, 01:10 PM
Chaos77777 Chaos77777 is offline
Member
 
Join Date: Jan 2017
Posts: 43
Gender: Male
Credits: 3,728
Chaos77777 is on a distinguished road
Default

Doesn't seem random to me. I keep getting the same thing over and over when I refresh after I adopt one. I have it set up to cost money, so the money does reduce. But it does give me the same adopt
Reply With Quote
  #7  
Old 02-19-2017, 01:39 PM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 113,399
Abronsyth is on a distinguished road
Default

You could probably work around this by setting it up so that once they adopt you quickly redirect them, which would mostly disable them from being able to refresh to just keep getting the same pet.
__________________
My Mods Site (1.3.4, 2020 Mods)
Reply With Quote
  #8  
Old 02-19-2017, 02:55 PM
kristhasirah's Avatar
kristhasirah kristhasirah is offline
Member
 
Join Date: Jan 2010
Location: In middle of the nothingness
Posts: 196
Gender: Female
Credits: 28,403
kristhasirah
Default

you can change the value in (1,300); 1 means one adopt and 300 the amount of clicks so is 1 adopt every 300 clicks, if i remember correctly from the original thread, maybe you can change it to a bigger number?
I dint make any more changes, but i think theres was a solution for that in the original thread... you just need to edit it to make it work in the new script

no need to edit the code just paste this:
http://mysidiaadoptables.com/forum/s...5&postcount=36 in the functions.php

and $clicked = 0; in the adopt.php

i pasted mine below
$total = ($ids)?count($ids):0;

Nevermind... Dont work on a cellphone :/
But it seems to work on a computer/laptop i used firefox to test it
__________________

Last edited by kristhasirah; 02-19-2017 at 05:32 PM.
Reply With Quote
  #9  
Old 02-19-2017, 04:50 PM
Chaos77777 Chaos77777 is offline
Member
 
Join Date: Jan 2017
Posts: 43
Gender: Male
Credits: 3,728
Chaos77777 is on a distinguished road
Default

I don't really know how to make a gif pic to show you what I mean. A redirect would work, but wouldn't show them the "Congrats you got this adopt" unless there's a way to show the same page in like a fake page type thing, which I don't know how to go about doing (Plus, "back" would still give them a loophole). Or a way to unset post, but I'm not really sure where to put that or how to set that up. But to recreate this (glitch):
1. Click which adopt you want.
2. Click the "Adopt me" button
3. When it shows you which adopt you got, just keep refreshing. In Chrome, it'll ask you if you want to submit form resubmission. You'll get the same one every time

Last edited by Chaos77777; 02-19-2017 at 05:27 PM.
Reply With Quote
  #10  
Old 02-19-2017, 05:47 PM
kristhasirah's Avatar
kristhasirah kristhasirah is offline
Member
 
Join Date: Jan 2010
Location: In middle of the nothingness
Posts: 196
Gender: Female
Credits: 28,403
kristhasirah
Default

It seems the glitch is part of mysidia script..i have the default one and got that problem too... Unless i forgot and edited something... But i thik the only thing i edited was ti add kytias female male images code... Rigth now i cant test that, using my phone...still even if the glitch is caused by the code i posted i have no idea in how to fix it... Maybe theres a fix somewhere in the forum...
__________________
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 06:22 AM.

Currently Active Users: 9789 (0 members and 9789 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636