ENTERZONE Global Script
Just an idea i have up in the air in at the moment. Obviously an ENTERZONE sub in the global player would apply to
all zones. But there's a little glitch in my plan, because there is some zones I don't want the script to run in. I could put the script in every zone player file, but global would be more practical. What I am looking at is running it in every "cancombat" zone only. (I am working with perl, not lua). Any ideas ? lol |
Several ways, varying in complexity and/or "work".
1. Likely the easiest unless you want to go at the source to add a new export, is: Code:
sub EVENT_ENTERZONE { 2. Read from the DB using DBI (though this would of course create a potential for many calls to the DB): Code:
sub readcombat { Code:
sub EVENT_ENTERZONE { So there's a start I hope. |
Quote:
non-combat zones. Just the regular common ones, GH, GL, PoK, Nexus, etc., so this would make it more simplified. I will check it tomorrow and let you know :) |
Well tried it out ghanja and it works great. I tested it out with just a simple little "movepc" for the #do something, lol
But had to change your ~~ to == (took me a few minutes to realize it) :P But thanks a million for your help. It opens up some options for me. :) EDIT : Sorry, not completely working right, I just let it do the movepc once and figured it was working great. It's not recognizing the nocombatzones. I set it to punt me to the nexus, but it does that even when in one of the zones specified. But I'll keep working on it. |
Please provide the code you're using. Smart matching should very much work.
|
I just used what you had to test the function of it with a movepc.
Code:
sub EVENT_ENTERZONE { |
Thats broke.. a single "=" just sets a variable to a value. :D
|
Quote:
which I changed over from ghanja's ~~ cause it wasn't doing anything |
Code:
sub EVENT_ENTERZONE { Yeah, Perl will throw a fit if you are doing a Perl -c script.pl on it, but, its syntax is fine. I'm under the assumption you're putting this code in your /quests/global/global_player.pl so ensure to target your test toon, issue a #reloadquest and then zone somewhere other than the test zones (which will be every zone not listed in the @noncombatzones array). That said, I would just use the plugin method, if you have the DBI ppm installed. |
Yes, I caught that freportn spelling the first time, but I never tested with that zone anyway. I was zoning into cancombat zones,
such as butcher, misty, etc., but nothing was happening until I changed the ~~ to == (as I mentioned in my post above) Then it would punt me to nexus, even zoning into a noncombat zone, (like runnyeye) or any zone, for that matter. This time I copied and pasted your last one into global_player.pl (I have #reloadquest hotkey) I use all the time. I've used the DBI for few things in the past, successfully, so I will look at using that instead. Thank You muchly :) |
This problem was solved by the way. It was too much human error and not enough human air. :P Seems I had a little
extra curly } hiding in the global player file before I pasted ghanja's script in there to test. But it works great now. Many Thanks to ghanja :) |
I do believe this may fly (I always doubt things when it seems all too easy):
embparser.cpp Replace line 1099 (as of current build) with: Code:
ExportVar(package_name.c_str(), "zonecancombat", zone->CanDoCombat()); To use: Code:
if ($zonecancombat) { |
Quote:
|
No go on that, but, this is what I did to compile.(as per the code posted)
Code:
void PerlembParser::ExportZoneVariables(std::string &package_name) { Code:
sub EVENT_ENTERZONE |
Bah, figured it was just too easy. I'll have another look at the source. Havent had eyes in it for awhile, so is a re-re-relearn type of deal for me.
|
All times are GMT -4. The time now is 10:39 PM. |
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.