koreTwitter - Twitter support for OpenKore (12/30/2008 #2)

Other plugins for extending OpenKore's functionality. This forum is only for posting new plugins and commenting on existing plugins. For support, use the Support forum.

Moderator: Moderators

Message
Author
Mushroom
Perl Monk
Perl Monk
Posts: 427
Joined: 04 Apr 2008, 14:04
Noob?: No
Location: Brazil

Re: koreTwitter - Twitter support for OpenKore (12/30/2008 #2)

#21 Post by Mushroom »

I'm using activeperl.
I got the module using Perl package manager and I had to download more 34 modules(pre-requisites).
Quit.

gamenikko
The Way Of Human
The Way Of Human
Posts: 192
Joined: 16 Aug 2009, 03:47
Noob?: Yes
Location: Gonryun

Re: koreTwitter - Twitter support for OpenKore (12/30/2008 #2)

#22 Post by gamenikko »

Mushroom wrote:I'm using activeperl.
I got the module using Perl package manager and I had to download more 34 modules(pre-requisites).
Yes i do us PPM and have packages more that 30,
look at this post
Hi, I'm Trying to install this plugin but have never used plugins before can you help?

Here is what I have done:
1-installed ActiveState on computer.
2-Searched Net::Twitter and istalled the package to c:/Perl which istalled 40 other package as well.
3-copy pasted the " koreTwitter.pl: Written by sli " to openkore plugins folder
4-added the lines" koreTwitter 1 koreTwitter_username twitterusername koreTwitter_password twitterpassword'
in my bot config with twitter username password.
5-launched openkore and then error could not find Net in src/.....

So I guessed I installed the package wrong can someone give me a more detailed explanation to get the package to openkore.

Thank you in advance for your help.
He's case is simillar to mine, i wonder why? its good to have your bots diary online ^^ finding out that your kore is more addicted to twitter than u are ahahaha ^___^
i hope sometime this plugin will work on me.
Just like old times.

kimmylee
Noob
Noob
Posts: 19
Joined: 02 Jun 2010, 08:18
Noob?: Yes

Re: koreTwitter - Twitter support for OpenKore (12/30/2008 #2)

#23 Post by kimmylee »

i am also having the same issue with error in syntax at line 16

using r7585 svn kore
ppm 4.11 activepearl
net twitter 3.14002
json 2.27

im not sure if i am doing it right since this is my first time using pearl ppm, once the package is installed, is there anything else i have to do to run it so kore and see an use it?

i also tried install Net::Twitter and install JSON in strawberry pearl as well, under the cpan command prompt, but with either setup i get the same line 16 syntax error,

using window 7 64bit

any ideas? i would love to use this plugin :(

glow
Noob
Noob
Posts: 4
Joined: 22 Jan 2011, 20:55
Noob?: No

Re: koreTwitter - Twitter support for OpenKore (12/30/2008 #2)

#24 Post by glow »

Nice plugin so i decided to update it for 2011.
What you need to do is create an app account on twitter and get 4 keys/tokens.
First register the "program" at the below url and then get a personal access token.
You can do that here: http://dev.twitter.com/

Oh yeah, i disbanded the @ and direct message. I didn't have any use for em so feel free to update.

Here is the updated twitter plugin.

Code: Select all

###############################
# koreTwitter.pl: Written by sli
# modified by gl0w - 2011
#                                 
# This plugin lets your bot post status
# status updates to a Twitter account.
#                                                   
###############################

# koreTwitter 1
# koreTwitter_consumerKey xxxxxxxxxxxxxxx
# koreTwitter_consumerSecret xxxxxxxxxxxxxxxxx
# koreTwitter_token xxxxxxxxxxxxxxxxxxxxxx
# koreTwitter_tokenSecret xxxxxxxxxxxxxxxxxxxxxxxxx
# koreTwitter_items Creamy Card, Hydra Card
# koreTwitter_ignoreDomains ingame, died, gm, msg

package koreTwitter;

use Plugins;
use Globals qw($char %config %timeout);
use Settings;
use FindBin qw($RealBin);
use Log qw(message);
use Misc;

use Net::Twitter;

Plugins::register('koreTwitter','Allows your bot to post status updates to Twitter.', \&onUnload);
my $hooks = Plugins::addHooks(
   ['start3', \&onLoad, undef],
   ['packet_privMsg', \&onPrivMsg, undef],
   ['base_level', \&onLevelUp, undef],
   ['self_died', \&onDeath, undef],
   ['job_level', \&onJLevelUp, undef],
   ['pvp_mode', \&onPvpMode, undef],
   ['avoidGM_near', \&onGm, undef],
   ['avoidGM_talk', \&onGm, undef],
   ['in_game', \&onInGame, undef],
   ['item_gathered', \&onItemFound, undef],
   ['Network::Receive::map_changed', \&onMapChange, undef]
);

my $cmd = Commands::register(
   ["tweet", "Posts a status update to Twitter.", \&cmdTweet],
);

our $dead = 0;
our $twit;

sub cmdTweet {
   my @args = @_;
   tweet($args[1], "manual");
}

sub onLoad {
   if (defined $config{koreTwitter_consumerKey} && defined $config{koreTwitter_consumerSecret} && defined $config{koreTwitter_token} && defined $config{koreTwitter_tokenSecret}) {
      $twit = Net::Twitter->new(
		  traits   => [qw/OAuth API::REST/],
		  consumer_key        => $config{koreTwitter_consumerKey},
		  consumer_secret     => $config{koreTwitter_consumerSecret},
		  access_token        => $config{koreTwitter_token},
		  access_token_secret => $config{koreTwitter_tokenSecret},
      );
   }
}

sub onPrivMsg {
   my @args = @_;
   tweet("From $args[1]{'privMsgUser'} : $args[1]{privMsg}", "msg");
}

sub onLevelUp {
   @args = @_;
   if($args[1]{name} eq $char->{name} || $args[1]{name} eq "You") {
   tweet("$char->{name} has gained a level! LVL $char->{lv}", "base"); # level added here so it doesn't post duplicates
   }
}

sub onJLevelUp {
   @args = @_;
   if($args[1]{name} eq $char->{name} || $args[1]{name} eq "You") {
   tweet("$char->{name} has gained a job level! LVL $char->{lv_job}", "job"); # level added here so it doesn't post duplicates
   }
}

sub onDeath {
   tweet("$char->{name} has died!", "died") unless ($dead);
   $dead = 1;
}

sub onPvpMode {
   tweet("WARNING: $char->{name} has entered a PVP area!", "pvp");
}

sub onGm {
   my $ucname = uc($char->{name}) unless $ucname;
   tweet("WARNING: GM IS NEAR $ucname!", "gm");
}

sub onInGame {
   tweet("$char->{name} is now in game.", "ingame");
}

sub onItemFound {
   my @args = @_;
   if ($config{koreTwitter_items} =~ /$args[1]{item}/i) {
      tweet("$char->{name} has found a $args[1]{item}! Rand: exp $char->{exp}", "item"); # exp added here to avoid duplicate entries
   }
}

sub onMapChange {
   # Prevents multiple notifications on death.
   $dead = 0;
}

sub tweet {
   my ($msg, $domain) = @_;
   if ($config{koreTwitter} == 1) {
		if($config{koreTwitter_ignoreDomains} =~ /$domain/i && $domain == "") {
			return;
		} else {
			$twit->update($msg);
		}
   }
}

sub onUnload {
   Plugins::delHooks($hooks);
   undef $ucname;
}

1;

frotek
Noob
Noob
Posts: 13
Joined: 29 May 2008, 23:29
Noob?: Yes

Re: koreTwitter - Twitter support for OpenKore (12/30/2008 #2)

#25 Post by frotek »

Nice plugin so i decided to update it for 2011.
What you need to do is create an app account on twitter and get 4 keys/tokens.
First register the "program" at the below url and then get a personal access token.
You can do that here: http://dev.twitter.com/

Oh yeah, i disbanded the @ and direct message. I didn't have any use for em so feel free to update.

Here is the updated twitter plugin.
error on line 27.

EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: koreTwitter - Twitter support for OpenKore (12/30/2008 #2)

#26 Post by EternalHarvest »

frotek wrote:error on line 27.
Read the first post.

kalansay
Human
Human
Posts: 39
Joined: 15 Apr 2008, 18:58
Noob?: Yes
Contact:

Re: koreTwitter - Twitter support for OpenKore (12/30/2008 #2)

#27 Post by kalansay »

I have Net-Twitter installed yet it is still returning error on line 27. |:

edit:

I have installed ActivePerl.

I have installed Net-Twitter using Perl Package Manager.

I have minGW installed using the installer I downloaded "mingw-get-inst-20110316"

I have added Perl and MinGW in my Environment Variables.

Yet, I have the following problems:

I tried to install MinGW using the command line it shows:

Image


When I use the command cpan in the command line it shows:

Image


I tried to install Net-Twitter using command line and it shows:

Image
For your CPU Usage & Memory usage concerns...
http://forums.openkore.com/viewtopic.php?f=10&t=33261
Image

hellsink
Noob
Noob
Posts: 12
Joined: 30 Oct 2009, 01:30
Noob?: Yes

Re: koreTwitter - Twitter support for OpenKore (12/30/2008 #2)

#28 Post by hellsink »

hello

i'm having a problem with this plugin, when bot gather the second item the bot crashes and show me this message:

Error message:
Status is a duplicate. at C:\Perl512\site\lib\Net\Twitter\Error.pm line 21

---------

Code: Select all

OpenKore version what-will-become-2.1
@ai_seq = attack route
Network state = 5
Network handler = Network::DirectConnection
SVN revision: 7673
Loaded plugins:
  plugins/kgrelogger.pl (kgrelogger)
  plugins/KoreTwitter.pl (koreTwitter)
  plugins/macro/macro.pl (macro)
  plugins/macro/recorder.pl (recorder)
  plugins/random.pl (randtimeout)

Error message:
Status is a duplicate. at C:\Perl512\site\lib\Net\Twitter\Error.pm line 21

Stack trace:
Status is a duplicate. at C:\Perl512\site\lib\Net\Twitter\Error.pm line 21
 at C:/Perl512/site/lib/Net/Twitter/Core.pm line 232
	Net::Twitter::Core::_parse_result('Net::Twitter::with__API_REST__OAuth=HASH(0x6215f04)', 'HTTP::Response=HASH(0x6cce464)', 'HASH(0x6ccbd04)', 'DateTime::Format::Strptime=HASH(0x599f774)') called at C:/Perl512/site/lib/Net/Twitter/Core.pm line 148
	Net::Twitter::Core::_json_request('Net::Twitter::with__API_REST__OAuth=HASH(0x6215f04)', 'POST', 'URI::http=SCALAR(0x6b3bddc)', 'HASH(0x6ccf954)', 1, 'HASH(0x6ccbd04)', 'DateTime::Format::Strptime=HASH(0x599f774)') called at C:/Perl512/site/lib/Net/Twitter/API.pm line 91
	Net::Twitter::Role::API::REST::update('Net::Twitter::with__API_REST__OAuth=HASH(0x6215f04)', 0) called at C:/Desktop/SVN/plugins/KoreTwitter.pl line 113
	koreTwitter::tweet('MoscaDF has found a Crina! Rand: exp 1179458', 'item') called at C:/Desktop/SVN/plugins/KoreTwitter.pl line 97
	koreTwitter::onItemFound('item_gathered', 'HASH(0x68f2724)', undef) called at src/Plugins.pm line 431
	Plugins::callHook('item_gathered', 'HASH(0x68f2724)') called at src/Network/Receive/ServerType0.pm line 3607
	Network::Receive::ServerType0::inventory_item_added('Network::Receive::bRO::Thor=HASH(0x33a8d94)', 'HASH(0x6ccf7f4)') called at src/Network/Receive.pm line 193
	Network::Receive::parse('Network::Receive::bRO::Thor=HASH(0x33a8d94)', '\x{d4}\x{2}"\x{0}\x{1}\x{0}\x{4}\x{4}\x{1}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{3}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}') called at src/functions.pl line 1329
	main::parseIncomingMessage('\x{d4}\x{2}"\x{0}\x{1}\x{0}\x{4}\x{4}\x{1}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{3}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}') called at src/functions.pl line 690
	main::mainLoop_initialized() called at src/functions.pl line 69
	main::mainLoop() called at src/Interface.pm line 75
	Interface::mainLoop('Interface::Console::Win32=HASH(0x46d534c)') called at C:/Desktop/SVN/plugins/openkore.pl line 97
	main::__start() called at C:/Desktop/SVN/plugins/openkore.pl line 187
Using:

perl: ActivePerl-5.12.2.1203-MSWin32-x86-294165
openkore 2.1 (7673)
macro plugin version 2.0.3-svn
macro.pl 6152
macro::Automacro 6573
macro::Script 5939
macro::Utilities 6578

SVN 7730 is got same error..

Puding
Human
Human
Posts: 38
Joined: 29 Jan 2009, 00:24
Noob?: No

Re: koreTwitter - Twitter support for OpenKore (12/30/2008 #2)

#29 Post by Puding »

I got the same problem of gamenikko. Help me.

And now, I cant find Net::Twitter on ActiveState, only on cpan > Net::Twitter.

Post Reply