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-15-2009, 08:02 PM
rosepose rosepose is offline
Member
 
Join Date: Jan 2009
Posts: 127
Credits: 10,493
rosepose
Default No Clicks at all?

I'm trying to teach myself PHP, and I was wondering which bits of the script contain parts that determine when the adoptable levels up, and how hard that would be to change to no clicks? I'm trying to get it to change after a certain amount of time, you see, like this:
PHP Code:
if ($date XX) {

  foreach (
$variation->age as $age) {
         if (
$age['date'] == "a") {
              
$pickedAge=$age;
         }
    }
}

  else if (
$date XX && $date >= XX) {

  foreach (
$variation->age as $age) {
         if (
$age['date'] == "b") {
              
$pickedAge=$age;
         }
    }
}

  else if (
$date >= XX) {

  foreach (
$variation->age as $age) {
         if (
$age['date'] == "c") {
              
$pickedAge=$age;
         }
    }
}

else {
echo 
"Cannot find that age";

Rather than with clicks, because the main thing that appeals to me about this script is that you can put your adoptables on an account. Even as the admin of my site, I'm still finding it hard to get mine to level up.
Reply With Quote
  #2  
Old 02-16-2009, 03:15 PM
BMR777 BMR777 is offline
Member
 
Join Date: Jan 2011
Posts: 1,122
Gender: Male
Credits: 10,548
BMR777 is on a distinguished road
Default RE: No Clicks at all?

Well, I can tell you that it will be rather tricky to convert from a clicks based system to a time-based one, simply because the script wasn't designed for time-based leveling. Here's the code though that controls when an adoptable levels up...

In levelup.php:

PHP Code:
//Check and see if we need a level up...
            
$levelup checklevel($totalclicks);
            if(
$levelup $currentlevel){
            
//The creature needs to level up
            //Check if we are at max level

            
$query "SELECT * FROM adoptable_rankimages WHERE name = '$type'";
            
$result = @mysql_query($query);
            
$num = @mysql_numrows($result);

            
//Loop out code
            
$i=0;
            while (
$i 1) {

            
$l1i=@mysql_result($result,$i,"l1i");
            
$l2i=@mysql_result($result,$i,"l2i");
            
$l3i=@mysql_result($result,$i,"l3i");
            
$l4i=@mysql_result($result,$i,"l4i");
            
$l5i=@mysql_result($result,$i,"l5i");    
            
$l6i=@mysql_result($result,$i,"l6i");
            
$l7i=@mysql_result($result,$i,"l7i");
            
$l8i=@mysql_result($result,$i,"l8i");
        

            
$i++;
            }
            
            
$mymax 8;
            if(
$l1i == "" || l1i == NULL){
            
$mymax 0;
            
$img $l1i;
            }    
            else if(
$l2i == "" || l2i == NULL){
            
$mymax 1;
            
$img $l2i;
            }
            else if(
$l3i == "" || l3i == NULL){
            
$mymax 2;
            
$img $l3i;
            }
            else if(
$l4i == "" || l4i == NULL){
            
$mymax 3;
            
$img $l4i;
            }
            else if(
$l5i == "" || l5i == NULL){
            
$mymax 4;
            
$img $l5i;
            }
            else if(
$l6i == "" || l6i == NULL){
            
$mymax 5;
            
$img $l6i;
            }
            else if(
$l7i == "" || l7i == NULL){
            
$mymax 6;
            
$img $l7i;
            }
            else if(
$l8i == "" || l8i == NULL){
            
$mymax 7;
            
$img $l8i;
            }


            if(
$currentlevel $mymax){
            
//Not at max level, rank them up
    
            
if($levelup == "1" and $mymax >= $levelup){
            
$img $l1i;
            }        
            if(
$levelup == "2" and $mymax >= $levelup){
            
$img $l2i;
            }
            if(
$levelup == "3" and $mymax >= $levelup){
            
$img $l3i;
            }
            if(
$levelup == "4" and $mymax >= $levelup){
            
$img $l4i;
            }
            if(
$levelup == "5" and $mymax >= $levelup){
            
$img $l5i;
            }
            if(
$levelup == "6" and $mymax >= $levelup){
            
$img $l6i;
            }
            if(
$levelup == "7" and $mymax >= $levelup){
            
$img $l7i;
            }
            if(
$levelup == "8" and $mymax >= $levelup){
            
$img $l8i;
            }

            
mysql_query("UPDATE owned_adoptables SET currentlevel='".$levelup."' WHERE uid='".$id."'");
            
mysql_query("UPDATE owned_adoptables SET imageurl='".$img."' WHERE uid='".$id."'");
            
$flag 1;
            
$currentlevel $levelup;
            }


            } 
There are two versions of that code in levelup.php, one for registered users and one for guests.

I would wait though until the new version comes out in a week or two before changing anything as the new version is a major rewrite. :)
Reply With Quote
  #3  
Old 02-16-2009, 06:03 PM
rosepose rosepose is offline
Member
 
Join Date: Jan 2009
Posts: 127
Credits: 10,493
rosepose
Default RE: No Clicks at all?

Yes, I'll wait. I'm trying it out now, and I have a basic script done which grows the adoptables after a certain amount of time (ah, success!) but I still can't figure out how to put them on an account.
Reply With Quote
  #4  
Old 02-16-2009, 06:12 PM
BMR777 BMR777 is offline
Member
 
Join Date: Jan 2011
Posts: 1,122
Gender: Male
Credits: 10,548
BMR777 is on a distinguished road
Default RE: No Clicks at all?

What do you mean by put them on an account? They should already be on a user's account as their adoptable, if that's what you mean.
Reply With Quote
  #5  
Old 02-16-2009, 09:54 PM
rosepose rosepose is offline
Member
 
Join Date: Jan 2009
Posts: 127
Credits: 10,493
rosepose
Default RE: No Clicks at all?

No, I have a script where it allows the person go get a pet simply by plugging in their name and pet name. They don't need to register at all, which makes it difficult to determine ownership. The script I've done chooses a random outcome from the ones I've made and makes the pets grow after a specified number of days.[hr]
You see, what I need to do is to integrate my existing script with the Easyadoptables script so that it will allow my users to add their adopted, time growing pets to an account.
Reply With Quote
  #6  
Old 02-17-2009, 03:52 PM
BMR777 BMR777 is offline
Member
 
Join Date: Jan 2011
Posts: 1,122
Gender: Male
Credits: 10,548
BMR777 is on a distinguished road
Default RE: No Clicks at all?

Ok, I see. I assume though that your script has saved in a database the username and adoptable type a user has, right? What you would probably have to do is make a conversion script in PHP for your script to the PHP EasyAdoptables Script.

The converter would have to allow users to make a new account on the EasyAdoptables script and then somehow import their adoptables into their new account. It can be done I think. You would simply create a new adoptable on the EasyAdoptables database for every old adoptable the user had, then adjust the clicks or time in the database for the new adoptable accordingly.

Hope it helps,
Brandon
Reply With Quote
  #7  
Old 02-19-2009, 01:39 PM
rosepose rosepose is offline
Member
 
Join Date: Jan 2009
Posts: 127
Credits: 10,493
rosepose
Default RE: No Clicks at all?

Erm... No, there's no database for that. The only SQL database I've made is one that saves the ID and the date. The ID pertains to the adoptable, which I specify the growth and images in a file called adoptables.xml. So, there's no username involved.

A conversion script? OK, so I somehow have to integrate my existing script with this other script.... *scurries away* How many of the pages in EasyAdoptables have bits that include the growth-by-click system?

-Rose[hr]
Oh, and I can get you a .zip file if you need one. Seeing as how I made the script, it's very basic.
Reply With Quote
  #8  
Old 02-19-2009, 06:30 PM
BMR777 BMR777 is offline
Member
 
Join Date: Jan 2011
Posts: 1,122
Gender: Male
Credits: 10,548
BMR777 is on a distinguished road
Default RE: No Clicks at all?

Well, the levelup.php file is the one that actually does the leveling of adoptables. The rest of the pages just pull or display the current level from the database.
Reply With Quote
  #9  
Old 02-20-2009, 08:34 AM
rosepose rosepose is offline
Member
 
Join Date: Jan 2009
Posts: 127
Credits: 10,493
rosepose
Default RE: No Clicks at all?

How difficult would it be to add something like this:
PHP Code:
if ($date 3
and
PHP Code:
else if ($date XX && $date >= XX) { 
under the levelup bits and have it work so that you need clicks and time? Would those codes work in the slightest?
Reply With Quote
  #10  
Old 02-20-2009, 08:58 AM
BMR777 BMR777 is offline
Member
 
Join Date: Jan 2011
Posts: 1,122
Gender: Male
Credits: 10,548
BMR777 is on a distinguished road
Default RE: No Clicks at all?

I don't know that you can measure date as a numerical value. Maybe you can though. I suppose you could do that somehow if you could measure date as a numerical value.

You would have to do something like this to the database:

Code:
alter table owned_adoptables add column leveldate varchar (30) ;
Then you would when the adoptable is created edit adopt.php to store the date as a numeric number, such as 1-1-2009 becomes 112009. Then when you level up you would get the current date and check it against the one in the database and only do the level if it matches your criteria. I suppose it can be done quite easily.

I wouldn't start on this yet though as a new release is right around the corner. :)
Reply With Quote
Reply

Thread Tools
Display Modes

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Freeze ONLY the evolution, not the clicks dulop Questions and Supports 2 09-28-2012 10:29 AM
Limit amount of clicks per day SilverDragonTears Questions and Supports 15 11-29-2011 11:50 AM
Limit clicks/day to 10 sensacion Questions and Supports 1 07-02-2011 05:15 AM
Days Instead of Clicks alonaria Suggestions and Feature Requests 7 06-25-2011 05:27 AM
Limit clicks/day to 10, for each pet? Quillink Questions and Supports 9 02-08-2010 02:35 PM


All times are GMT -5. The time now is 04:28 AM.

Currently Active Users: 457 (0 members and 457 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