|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Quests::Custom Custom Quests here |
05-10-2014, 03:41 PM
|
Administrator
|
|
Join Date: May 2013
Location: United States
Posts: 1,594
|
|
Custom Teleporter.
I wrote a custom teleporter and I thought I'd share it, for an example of its use you can check out Valcarona. This teleporter lists out an array of zones defined in a plugin that you will have to make a file for.
This is a screenshot of the teleporter and how it works, Valcarona's is older, so it lists as short name. This new version lists them as their long name.
Here are the plugins necessary for the script to work: Plugins
Here's the Teleporter: Teleporter
|
06-15-2014, 06:16 PM
|
|
Sarnak
|
|
Join Date: Dec 2013
Posts: 46
|
|
Thanks for this Kingly.
I've got it working with the exception of the "list them alphabetically" option.
If I type the zone short name with the NPC targeted, I do indeed zone.
If I type "A", I get nothing from the NPC.
The plugin that was linked was named "Zones.pl", but it mentions in the post "Plugins", is this two plugins in one file?
Currently, I'm using one plugin file named "Zone.pl" in my server/plugins folder.
And the teleporter code on an NPC in PoK.
Edit: Additionally, if I have the NPC targetted and enter numbers, I do get the "...must search with alphabetic characters",
so it seem he is listening, just can't get the output.
Thanks!
Last edited by vithmiris; 06-15-2014 at 06:22 PM..
Reason: Add troubleshooting info
|
06-15-2014, 11:41 PM
|
Administrator
|
|
Join Date: May 2013
Location: United States
Posts: 1,594
|
|
The problem is I released this and forgot that I didn't give out the plugin::Message part of it.
Add this to your plugin file and tell me if it works:
Code:
sub Message {
my $client = plugin::val('client');
my $Message = $_[0];
if($client) {
$client->Message(315, "$Message");
}
}
|
06-16-2014, 05:42 PM
|
|
Sarnak
|
|
Join Date: Dec 2013
Posts: 46
|
|
Quote:
Originally Posted by Kingly_Krab
The problem is I released this and forgot that I didn't give out the plugin::Message part of it.
Add this to your plugin file and tell me if it works:
Code:
sub Message {
my $client = plugin::val('client');
my $Message = $_[0];
if($client) {
$client->Message(315, "$Message");
}
}
|
Works beautifully! Thanks again!
|
06-16-2014, 09:24 PM
|
Administrator
|
|
Join Date: May 2013
Location: United States
Posts: 1,594
|
|
You're welcome.
|
05-07-2018, 07:50 AM
|
|
Fire Beetle
|
|
Join Date: Apr 2018
Posts: 19
|
|
Great porter script. Anon server thanks you.
Quote:
Originally Posted by Kingly_Krab
I wrote a custom teleporter and I thought I'd share it, for an example of its use you can check out Valcarona. This teleporter lists out an array of zones defined in a plugin that you will have to make a file for.
This is a screenshot of the teleporter and how it works, Valcarona's is older, so it lists as short name. This new version lists them as their long name.
Here are the plugins necessary for the script to work: Plugins
Here's the Teleporter: Teleporter
|
|
05-07-2018, 12:14 PM
|
Administrator
|
|
Join Date: May 2013
Location: United States
Posts: 1,594
|
|
You’re welcome. I’m sure the code could use some TLC being it has been 4 years since I wrote it.
|
08-27-2018, 11:40 PM
|
Fire Beetle
|
|
Join Date: Apr 2017
Posts: 4
|
|
was trying to put something together for a porter that charged for ports just like that whisper script for buffs. any tips?
|
|
|
|
08-28-2018, 05:29 PM
|
Administrator
|
|
Join Date: May 2013
Location: United States
Posts: 1,594
|
|
Try this, currently $client->TakeMoneyFromPP() only checks if they have at least 1 Platinum, the value is number of Platinum times 1000 to convert it to Copper.
Just change the price to your discretion and this should work.
Untested, compiles fine using 'perl -c':
Code:
sub EVENT_SAY {
my @zone_array = plugin::NonCustomZoneArray();
my $count = 0;
if ($text=~/hail/i) {
plugin::Whisper("If there is a zone you would like to go to, just tell me the short name of it and I will see if I have a spell to send you there. I may " . quest::saylink("list", 1) . " them if you like. It will cost 1 Platinum to teleport.");
} elsif($text=~/list/i) {
plugin::Whisper("I may list them alphabetically, just say a letter from 'A' to 'Z'.");
} elsif($text=~/[a-zA-Z]/ && length($text) == 1) {
foreach $zone (@zone_array) {
if(substr($zone, 0, 1)=~/$text/i) {
$count++;
plugin::Message("$count: " . quest::saylink($zone, 1, plugin::Zone("SN", "LN", $zone)));
}
}
plugin::Message("There are $count zones that begin with $text!");
} elsif($text!~/[a-zA-Z]/) {
plugin::Whisper("You must search with alphabetic characters, try again.");
} elsif($text!~/hail/i && $text!~/list/i && length($text) != 1) {
foreach $zone (@zone_array) {
if ($client->TakeMoneyFromPP(1000, 1)) {
if($text eq $zone) {
quest::zone($text);
}
} else {
plugin::Whisper("You do not have enough Platinum to teleport.");
}
}
}
}
|
|
|
|
08-29-2018, 05:48 AM
|
Fire Beetle
|
|
Join Date: Apr 2017
Posts: 4
|
|
thank you kind sir it was very appreciated!
|
08-29-2018, 04:52 PM
|
Administrator
|
|
Join Date: May 2013
Location: United States
Posts: 1,594
|
|
You're welcome.
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 07:46 PM.
|
|
|
|
|
|
|
|
|
|
|
|
|