Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Technical Support » Win32 FDS » !spectate <player> and BRenBot.
Re: !spectate <player> and BRenBot. [message #385981 is a reply to message #385969] Thu, 14 May 2009 11:06 Go to previous messageGo to previous message
HanGul815 is currently offline  HanGul815
Messages: 13
Registered: May 2009
Location: South Korea, Republic
Karma:
Recruit

ok I run !spectate what u loaded and here is the result.

http://img523.imageshack.us/img523/7080/55070222.png


this is spectate.pm what u loaded
Quote:

#
# Spectate plugin for BRenBot 1.51 by Daniel Paul
#
# Version 1.00
#
package spectate;

use POE;
use plugin;

# define additional events in the POE session

our %additional_events =
(
# !command functions
"spectate" => "spectate"
);

# BRenBot automatically sets the plugin name
our $plugin_name;

# BRenBot automatically imports the plugin's config (from the xml file) into %config
our %config;

our $currentVersion = 1.00;


########### Functions for !commands

# Set spectate mode on a player
sub spectate
{
my %args = %{@_[ ARG0 ]};

# Check they supplied a name or ID to search for, if they have not bail out
if ( !$args{arg1} )
{
my $syntaxvalue = $args{settings}->{syntax}->{value};
$message = "Usage: $syntaxvalue";
return;
}

# Try to find the player by name or ID
my ( $result, %player ) = plugin::getPlayerData( $args{'arg1'} );
if ( $result == 1 )
{
# Player found, spectate them
plugin::RenRemCMD("r_spec $player{id}");
plugin::ircmsg ("10[Spectate] Player $player{name} is now in spectate mode.",'A');
}
else
{
if ( $args{nicktype} == 1 ) { plugin::ircmsg ( "Player $args{arg1} not found ingame", $args{'ircChannelCode'} ); }
else { plugin::pagePlayer ( $args{'nick'}, "Player $args{arg1} not found ingame" ); }
}
}


########### Event handlers

sub start
{
plugin::set_global ( "version_plugin_spectate", $currentVersion );
}


sub stop
{
# Nothing to do

}


sub command
{
my $kernel = $_[KERNEL];
my %args = %{@_[ ARG0 ]};
$kernel->yield( $args{'command'} => \%args);
}


# Return true or the bot will not work properly...
1;



and this is spectate.xml
Quote:

<?xml version="1.0" ?>

<plugin name="spectate">
<command name="spectate">
<permission level="2"/>
<syntax value="!spectate &lt;player&gt;"/>
<help value="Sets the specified player to spectate mode."/>
<enabled value="1"/>
<hideInHelp value="1"/>
<group>irc</group>
</command>
<events>
<event>command</event>
</events>
<config>
<!-- No config settings for spectate plugin... -->
</config>
</plugin>



I'm a n00b a brenbot and think I did something wrong but don't know what it is. plz help me. Big Grin
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: BRenbot goes down randomly.
Next Topic: Changing the Host Name
Goto Forum:
  


Current Time: Wed Dec 18 21:48:34 MST 2024

Total time taken to generate the page: 0.00882 seconds