Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Ecko

Pages: [1]
1
Coding / Re: Send automated PM?
« on: October 14, 2006, 04:43:01 am »
So if I had an item that displays a random quote or something and have it return( after the item has been used, I can also make it send that same message to myself and the person who used the item?

Code: [Select]
<?php
/**********************************************\
| SMFSHOP (Shop MOD for Simple Machines Forum) |
|         (c) 2005 DanSoft Australia           |
|      http://www.dansoftaustralia.com/        |
\**********************************************/

//File: FireScroll.php
//      Test Item (requires NO input)

//VERSION: 1.0 (Build 1)
//DATE: 12h October 2006
// $Id: FireScroll.php 3 2006-10-12 10:01:21Z eckostylez $

//your class should always be called item_filename, eg. if your file is 
//myCoolItem.php then the class should be called 'item_myCoolItem'. This 
//class should always extend itemTemplate.
class item_FireScroll extends itemTemplate {
    
    
//when this function is called, you should set all the item's
    //variables (see inside this example)
    
function getItemDetails() {

        
//VALUES CHANGABLE FROM WITHIN ADMIN PANEL:
          //the name of the item
          
$this->name "Firebending Scroll";
          
//the item's description
          
$this->desc "Learn a new attack! Or an old one...!";
          
//the item's price
          
$this->price 500;
          
        
//UNCHANGABLE VALUES:
          //whether the item requires input or not. In this case, we don't need
          //any input
          
$this->require_input false;
          
//set this to 'false' if the item is unusable. This is good for display
          //items.
          
$this->can_use_item true;
    }

    
//since this item requires no input, we don't need to have a getUseInput function
    //here (see the testitem2.php file if you want to make an item that needs input.


    //the is where all the fun begins. This function is called when 
    //the user actually uses the item. Return stuff, DON'T ECHO!
    
function onUse() {
         
$quotes = array('You learned Fire Kick - 3 DMG''You learned Flaming Punch - 2 DMG''You learned Lightning Strike - 5 DMG');
         return (
$quotes[rand(0count($quotes) -1)]);
 
    }
}


?>


After the function onUse() part is the array that holds the random "quotes" and then it returns it to them in the next box.

What would I add to make it send a PM to me and the person who used the item with the same message from the array?

2
Edit:

I changed it by using an array instead of making it read from a file. Longer, but it works so meh.

Now I just need it to send that same message to both the user and Admin :X

3
Lol, when I meant I get no error when I use the item, I also meant to put that nothing happens.

It's supposed to return a line from fireattacks.txt, but it does not. Help pls?

4
Coding / Re: Send automated PM?
« on: October 13, 2006, 10:56:25 am »
Check out my other post in your item creation guide.

I keep getting that error, and so far I've got it so that it it will randomly select a selection of words from a .txt file and tell it, but I also want it to PM that to an Admin and the User.

5
I get no error when I use my item, but I get this error if I go to it directly:


Fatal error: Class item_firescroll: Cannot inherit from undefined class itemtemplate in

Here it is:

Code: [Select]
<?php
/**********************************************\
| SMFSHOP (Shop MOD for Simple Machines Forum) |
|         (c) 2005 DanSoft Australia           |
|      http://www.dansoftaustralia.com/        |
\**********************************************/

//File: testitem.php
//      Test Item (requires NO input)

//VERSION: 1.1 (Build 4)
//DATE: 10th April 2005
// $Id: testitem.php 3 2006-07-08 10:01:21Z daniel15 $

//your class should always be called item_filename, eg. if your file is 
//myCoolItem.php then the class should be called 'item_myCoolItem'. This 
//class should always extend itemTemplate.
class item_FireScroll extends itemTemplate {
    
    
//when this function is called, you should set all the item's
    //variables (see inside this example)
    
function getItemDetails() {

        
//VALUES CHANGABLE FROM WITHIN ADMIN PANEL:
          //the name of the item
          
$this->name "Firebending Scroll";
          
//the item's description
          
$this->desc "Learn a new attack! Or an old one...!";
          
//the item's price
          
$this->price 500;
          
        
//UNCHANGABLE VALUES:
          //whether the item requires input or not. In this case, we don't need
          //any input
          
$this->require_input false;
          
//set this to 'false' if the item is unusable. This is good for display
          //items.
          
$this->can_use_item true;
    }

    
//since this item requires no input, we don't need to have a getUseInput function
    //here (see the testitem2.php file if you want to make an item that needs input.


    //the is where all the fun begins. This function is called when 
    //the user actually uses the item. Return stuff, DON'T ECHO!
    
function onUse() {
         
$quotes file('fireattacks.txt');
         return (
$quotes[rand(0count($quotes) -1)]);
 
    }
}


?>


6
Coding / Send automated PM?
« on: October 13, 2006, 06:28:06 am »
I am a complete neeb when it comes to coding. Can someone help me make an item that somewhat fits this description:

First you buy the item, then you use it. When you use it, I want it to randomly select from a list of phrases or words that have already been defined. Example:

+1 Attack
+1 Defense
+1 HP
-1 Attack
-1 Defense
-1 HP

So when you use this item, it selects one of those and then it tells them You've just gained/lost _____.

Then, as soon as they use it, it sends an automated PM to the Administration saying the exact same thing it says to the user.

7
Installation Problems / Execute Modification error
« on: October 03, 2006, 06:50:19 am »
Installations actions for "SMFShop":
Installing this package will perform the following actions:
   Type    Action    Description
1.    Extract Tree    ./Sources/shop    
2.    Extract File    ./Themes/default/images/english/shop.gif    
3.    Extract File    ./Themes/default/languages/Shop.english.php    
4.    Extract File    ./Themes/default/ShopAdmin.template.php    
5.    Extract File    ./Themes/default/Shop.template.php    
6.    Execute Modification    -                                                                                          [Modification parse error
7.    Execute Code    installScript.php    

Any idea how to fix?

Pages: [1]