DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • November 12, 2018, 10:17:00 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: Hooks for Crazy Audrey  (Read 4699 times)
0 Members and 1 Guest are viewing this topic.
ges
Guest
« on: March 22, 2005, 08:54:59 PM »

Hi there!

One of my users suggested having a module that allows somone (or maybe, just a thief) to steal money from Crazy Audrey when she's in the village.

I'm happy to give it a go, but I can't find where to hook into the Crazy Audrey menu.

Is there a hook I can use and, if not, is it possible to add one?

Thanks,
ges
Logged
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #1 on: March 22, 2005, 09:11:18 PM »

Just gonna summarize:

Code:
// In Install:
module_addhook("footer-runmodule");

// Then in dohook:

case "footer-runmodule":
/*
if you want only thieves as well as it to show up in pet (The area where it displays the amount of gold) ^_^
*/
$mod = httpget('module');
if ($mod == "crazyaudrey" && $session['user']['specialty'] == "TS" && httpget('op') == "pet"){
//code for navs
}
break;
« Last Edit: March 23, 2005, 05:41:44 AM by Sichae » Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

Eth
Member
Codemeister
****
Offline Offline

Posts: 302


Shameless Drunk


View Profile
« Reply #2 on: March 22, 2005, 09:17:41 PM »

That works better. *removes his first post*

Since ges is relatively new around here, I wasn't sure if he was familiar with adding the hook to the install part.
« Last Edit: March 22, 2005, 09:18:27 PM by Eth » Logged

Purveyor of fine cloaks, gloves, boots, gerbils, and Siamese cats.
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #3 on: March 22, 2005, 09:21:12 PM »

That works better. *removes his first post*

Since ges is relatively new around here, I wasn't sure if he was familiar with adding the hook to the install part.

Yes, very nice.

* Sichae storms off, to nurse his wrist. Because he stupid-ass brother, decided to pelt him with a ball, and then knock over a glass, full of water, all over his desk and keyboard.
Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #4 on: March 22, 2005, 10:38:03 PM »

:points at Sichae...
You know, that footer-crazyaudrey will not work?!

The hook needed is "footer-runmodule" and then check if "httpget('module') == 'crazyaudrey'".

That should work...

Logged

Running for more than three years now:
CortalUX
Dwellings Project
Mod God
*****
Offline Offline

Posts: 796


Wogga! Meep!


View Profile WWW
« Reply #5 on: March 23, 2005, 03:10:04 AM »

That won't always work either.. if it's a village/forest special you'll need to check the specialinc as well.
I think it's this (if it's a village/forest special)
case "footer-forest":
case "footer-village":
if ($session['user']['specialinc']=='module:crazyaudrey') {
}
Logged
Booger
Captain of the Guard
***
Offline Offline

Posts: 126


I'm a llama!


View Profile
« Reply #6 on: March 23, 2005, 03:12:18 AM »

audrey is not a special in the village. and I think you can only see the money in town, so you could probably forget the forest..
« Last Edit: March 23, 2005, 03:12:37 AM by Booger » Logged
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #7 on: March 23, 2005, 03:14:10 AM »

to steal money from Crazy Audrey when she's in the village.

In this case my solution will work...

otherwise the hook footer-runmodule will not get called... because then it'll be footer-forest...

*whistles a tone and leaves... Smiley
Logged

Running for more than three years now:
CortalUX
Dwellings Project
Mod God
*****
Offline Offline

Posts: 796


Wogga! Meep!


View Profile WWW
« Reply #8 on: March 23, 2005, 03:16:58 AM »

Ah, ok.
I've just looked at the code: I think it'd be this:
case "footer-runmodule":
   if (httpget('module')=='crazyaudrey'&&httpget('op')=='pet') {
      $profit = get_module_setting('profit','crazyaudrey');
      if ($profit>0&&get_module_pref('steal')==0) {
         addnav("Steal from Crazy Audrey","runmodule.php?module=crazyaudreysteal&op=start");
      } else {
         output("Crazy Audrey ??"); // Not sure what to put
      }
   }

Edit: *nods to XChrisX* - remembering that you'd make a "steal"=>"Has this user tried to steal from Crazy Audrey?,bool|0" pref.
« Last Edit: March 23, 2005, 03:18:14 AM by CortalUX » Logged
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #9 on: March 23, 2005, 05:25:40 AM »

:points at Sichae...
You know, that footer-crazyaudrey will not work?!

Lower thy finger. Tongue

Oddly enough, that is what I first posted. Then upon remembering an old post, I then change it to include both, and then though different, and removed runmodule hook alltogether.

Yes I know.

Although, one would begin to think, that all documents maintaining a page_footer, would allow for such a hook into them, dependant upon the filename.
« Last Edit: March 23, 2005, 05:27:35 AM by Sichae » Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #10 on: March 23, 2005, 05:53:21 AM »

Yes well... That's what I suggested a couple of months ago, but due to the reason someone might want to hook into "footer-runmodule" Kendaer wiped that idea away  Grin
Logged

Running for more than three years now:
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Version 1.1.2 is the current supported version and is available for download.

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
61 Guests, 1 User
EJno1
Home Forums News Downloads Login Register Advanced Search