PDA

View Full Version : Osiris the bot



Hovi
9th December 2007, 11:50 AM
Hello, I am posting to present you our bot - Osiris. Nothing much to say, I included documentation (I know its sucky)
and screenshot so you can check what features it has without downloading. For any questions, just post here or contact me
this is beta version, more feedback = better. If you want to become betatester, let me know.
Enjoy!

Osiris beta documentation

This is the documentation of our advanced PvPGN bot, which was specifically designed for
Warcraft 3 PvPGN servers.
It is only a beta version (216), which means it can (and surely will be :) ) bugged. Please
report all bugs that you find at kaja.hovi@seznam.cz (either email or msn), or
just simply send me private message through forum.
Please send error message, operating system and what might cause the bug.

Authors:
This program is made by Hovi, Firebird of clan N0TD and Anomandaris of clan BoS.

Features:

The bot has many many features and more are coming soon.
Each feature has its own "handler" that implements the feature. Handlers
are divided into core handlers and other handlers.

Core handlers:

Core handlers are part of bot core and some of them are necessary for bot to run.
They are:
AccessHandler - Handler that takes care of access to bot (groups and modifying)
them. For example in ss guard, there is safelisted group, ssmod group, which can
modify safelisted group, etc.

ChannelHandler - Handler that keeps information about current channel and people
inside.

ChatHandler - Handler that can be used for chat without graphics user interface.

LoggingHandler - Handler that takes care of chatlogs.

LoginHandler - Handler used for login.

Other handlers:

PlaysoundHandler - Handler for playing sound after command "~playsound file.wav",
same way as in topazchat, however this handler works correctly only in Windows
(in linux it works too, but uses old oss driver, which makes it almost useless).

RepeatHandler - Handler to send timed messages: you can set the interval, how many
times to repeat - if not indefinitely, or at what time.

ResponseHandler - Handler for sending responses to triggers. Similar feature is
in topazchat, but this one is more advanced.

There are also other Handlers, but they either aren't finished, or aren't needed
for this beta version. Just to mention, there is handler for moderating channel,
handler for safelisted/banlisted channel, handler for loading codes from games
(like Notd2, NotDAM, NotD:SO), handler for managing clan, for watching games,...
You might know some of them from ss "Guard" or clan N0TD "N0TD" bots.

All bot settings are stored in xml files with many options which makes them
easy to edit and gives many various configuration options.

Important thing is, that there is a possibility to create your own handler for
anything you want - all you need is the AbstractHandler.java source file and knowledge
of Java. If you need any help, feel free to contact us.

Getting started:

1, First you need to have a system with the Java Runtime enviroment 1.6 (downloadable
from www.java.sun.com).

2, Download bot, extract zip file to a directory.

3, Edit bot.xml in settings directory.
Fill in login information.
(you might need to change server adress to "eurobattle.net" or "track.eurobattle.net", if bot doesn't want to connect)

4, Bot has by default set some default repeated messages ("test message", etc). If you want to turn them off,
delete "repeatmessagesettingssample.xml".

5, Turn it on simply by clicking start.bat (in windows), or by command
"java -jar OsirisXXX.jar -gui bot.xml".
In linux you can use command "bash start.bat" ofc :)

Configuring basic handlers:

I think example is always the best and easiest way to understand, check out
settings directory, especially bot.xml, repeatmessagesettingssample.xml and
Responses.xml.

Sounds.
I included basic sound files (from topaz), but we recommend you to use additional
pack made by greek and demkit of N0TD.
http://www.eurobattle.net/showthread.php?t=52290


The boring stuff:

Platform:
Program is made in java and is supposed to be platform independent, that means
it should be runable on any platform that runs Java 1.6.

Versions:
There are several versions of bot, depending of what features are used. Most
used version will probably be the gui chat version, which is similar to TopazChat.

There is also a text version that doesn't require a graphical environment to run.

The last version to mention is the server one, that should be runnable remotely on any
Java 1.6 supporting machine.


Edit:
new version is now available at:
http://www.eurobattle.net/showthread.php?t=78459

TP_MoonStar
9th December 2007, 12:50 PM
Sticked and i'll post some stuff for you :)

AJalex
9th December 2007, 01:44 PM
well i downloaded the bot , configured it , added my logins and still nothing

it doesn't connect

Hovi
9th December 2007, 01:48 PM
Maybe you need to use another address (track.eurobattle.net or eurobattle.net) instead.

AJalex
9th December 2007, 01:56 PM
done , with eurobattle.net adress

cool hovi nice job :)

EDIT:can't you put a BOT tab to edit the bot things? like in topaz?

it would make life easier

Hovi
9th December 2007, 01:59 PM
It is already done, but that part isn't ready for release.

AJalex
9th December 2007, 02:01 PM
k

i don't know where this came from or it is from me but i alt tabed in game with my other account and when i came back to the bot it was not responding ... T_T

SaladFingerPL
9th December 2007, 02:15 PM
Btw Hobi - is this project you've been working of with Birdie and Ano recently?

Edit nvm, didn't read you post first:p gonna try it out now

Hovi
9th December 2007, 02:17 PM
Salad if you read carefuly, you would notice sentence:
"This program is made by Hovi, Firebird of clan N0TD and Anomandaris of clan BoS."
:)

Ajalex: Sounds weird, any errors from console?

AJalex
9th December 2007, 02:19 PM
nope

this hapened to me and still happens sometimes when i am using topaz to

alt+tab to w3 alt+tab to bot and no response .... it doesn't respond

Hovi
9th December 2007, 02:28 PM
Hmm... I can't test that atm because I don't have windows installed :-/

AJalex
9th December 2007, 02:31 PM
well i think't it's from me
this hapened with raptor to

if you need further help with testing just tell me :D

Hovi
9th December 2007, 02:32 PM
Thanks, just... use it and "complain" :)

Xfire
9th December 2007, 02:46 PM
Good job sir :tiphat:

TP_MoonStar
9th December 2007, 03:18 PM
You need to encrypt password/username for admin/mod usage .

TP_MoonStar
9th December 2007, 03:19 PM
maybe taskbar would be nice as well or someway dos tab with chat tab

two tabs whiout taskbar kinda sux for someone who do multitasks like me ;/

Hovi
9th December 2007, 03:29 PM
Can you elaborate (the password thing)?

Abou the tabs, this is the simpliest version, there is another that has another windows for handling more bots at once, etc.

TP_MoonStar
9th December 2007, 03:38 PM
Yes sorry let me take you a screenshot it will make things easier.

1- First task bar
2- Second task bar
3- Passwords can be clearly seen there can you make it like *** or somenthing like that?


Others :

What i meant with 1,2 is to make it on the same window if its possible and put as taskbar near clock.

Hovi
9th December 2007, 03:41 PM
If you mean that password is visible in console, yes you are right, I don't like that either. It's about to be changed. :)

Ah, well the command line doesn't have to be visible at all, if you use windows link.

TP_MoonStar
9th December 2007, 04:00 PM
bug found :
71912


You can see i /dnd like 20 min ago and cmd log still get the message and parse there.

Hovi
9th December 2007, 04:02 PM
That "test message" is what you are sending, not receiving, you better turn that off :) (by deleting repeatmessagesettingssample.xml or setting repeathandler as false).

TP_MoonStar
9th December 2007, 04:28 PM
i saw this almost 30 min after spamming server with test message xD rofl

Plavsha
9th December 2007, 04:40 PM
test message

Hovi
9th December 2007, 04:44 PM
So it looks like bot crashes after few hours of running cause of gui.

TP_MoonStar
9th December 2007, 05:04 PM
didnt crash for me ;)

AJalex
9th December 2007, 07:47 PM
well it didn't crash for me either ...

but i have a couple (or maybe more) suggestions

i will make a list :)

(they are simple GUI suggestions)

Hovi
9th December 2007, 08:23 PM
Cool :)

AJalex
9th December 2007, 09:52 PM
ok here it goes:

When the program starts make it start in full resolution / fullscreen and make the whisper and users online section bigger at startup

Add tabs similar to topazchat to make ti more user friendly :)

If you can make another section beneath the online users in chat and whisper area a place where the watched players will be shown to not interfeer with the main chat (if you can)

;)

and i wish you could help me with the christmas bot :) a bit :)


EDIT:damn it performs so well with spam :wtf:

i made a topaz bot to spam osiris and it performed uber good xD
so on a raiting from 1 to 10 i give it a 7 :) for now

gj hovi as always :D

Keka
9th December 2007, 10:37 PM
nice idea i would like to get that christmas bot too if it isnt a problem

Hovi
9th December 2007, 10:40 PM
Whats xmas bot?

AJalex
9th December 2007, 11:16 PM
a bot that asks questions and who has the most answers correct is the winner and will get a prize from the administrators (wins/icons etc they decide)

just look in the private forum :D to make long story short

Hovi
9th December 2007, 11:19 PM
Ah, so basicly trivia game... hmm I was planing to do that, but I don't think I can finish it before xmas.

AJalex
9th December 2007, 11:27 PM
i can help u man :D

that's why i asked :)

Hovi
9th December 2007, 11:36 PM
Let's talk on msn then.

AJalex
10th December 2007, 09:58 AM
i added you in my yahoo list (msn is screwed 4 me xD)

SaladFingerPL
10th December 2007, 03:09 PM
yey, my bot became victim of "test msg"

TP_MoonStar
10th December 2007, 03:18 PM
welcome to the test message team salad :)

SaladFingerPL
10th December 2007, 04:36 PM
Yeah :-) I left it on at W3 channel and unluckly cute PandaSellFrig got banned :-(

Hovi
15th December 2007, 01:11 PM
New version.

Some of major changes:

-Main window for creating and managing bots added (no need to setup manually by editing xml anymore).
-Tabbed chat windows.
-winstart.bat to run on windows without need of console
-faster gui

Edit: Yes, icons in main window are ugly... anyone volunteering to make better ones? :)

mirror:

http://hovi.grilledfish.be/osiris/Osiris_0_221.zip

Hovi
15th December 2007, 01:17 PM
And about the test message... :)



[15:16] scorrpio: lol
[15:16] TP_MoonStar: test message
[15:16] [WHAAAT]: ej
[15:16] [LKK]Kluch4: test message
[15:16] [WHAAAT]: hell
[15:17] Thralla: me to bavi
[15:17] [ro]daniel: test massage
[15:17] TP_MoonStar: test message
[15:17] [LKK]Kluch4: test message
[15:17] chicken_spot: fuck you
[15:17] chicken_spot has been kicked by TP_MoonStar (bad manners!).
[15:17] TP_MoonStar: i will mass lock accounts if this stupid test message continue
[15:17] scorrpio: lol
[15:17] TP_MoonStar: test message
[15:17] chicken_spot: it works :D
[15:17] [LKK]Kluch4: so you will lock yourself moonstar ?

AJalex
15th December 2007, 04:37 PM
And about the test message... :)

lol .... next time in the package delete the test message thing :D

Killer Bee Bop
16th December 2007, 06:55 PM
Since I am too lazy to rephrase this "bug report", I'll just post as is, sorry bear with me. : ))



[18:26] Killer_Bee_Bop: ah there he is
[18:26] Killer_Bee_Bop: Hovi, I noticed that Osiris not only drops from B.net too often (could be my ISP as we said earlier)
[18:27] Killer_Bee_Bop: but also it doesn't update chat window
[18:27] Killer_Bee_Bop: unless one sends often or from time to time at least
[18:28] [rA]Mer: woo sst vs tss become funny :>
[18:28] Killer_Bee_Bop: so for example if I afk for some time, come back, type something, it will then BOOM wake up, empty
[18:28] Killer_Bee_Bop: the buffers or whatever is holding the chat lines
[18:28] Lukass: rake
[18:28] Lukass: jeste s./
[18:28] Lukass: ?
[18:28] Killer_Bee_Bop: and then the chat shows up, and whatever you sent as well
[18:28] [rA]Mer: lukass pls english :>
[18:28] GU.TianCaiWuDi: hello all
[18:28] GU.TianCaiWuDi: i'm new to ss
[18:28] [rA]Mer: or send message on priv
[18:29] Lukass: :D
[18:29] Lukass: okok
[18:29] Killer_Bee_Bop: Mer nob pfft :)
[18:29] Lukass: rake are u there :D
[18:29] Lukass: ?
[18:29] LifeDrainer[RO]: i think rake is reading forum
[18:29] Rake: y
[18:29] LifeDrainer[RO]: or no
[18:29] LifeDrainer[RO]: :)
[18:29] Hovi: killer_b_b
[18:29] Rake: so many fcking problems -.-
[18:29] ss-max: -.-
[18:29] Hovi: could you post those stuff at forum?
[18:29] Killer_Bee_Bop: I guess
[18:29] Hovi: tx a lot
[18:29] Killer_Bee_Bop: but I'm lazy :D
[18:29] LifeDrainer[RO]: ^^
[18:29] Killer_Bee_Bop: I'll just take ss of this chat and post it :D

2fuckingbitch
19th January 2008, 01:59 PM
This new bot is better than older.... Because older have some bugs with English :D ... He kick u when u say HAHA ... and u start piss him.... Btw this new is very good and because my Rl friend host Older one , i see that this is much easier to host than last one .. this is very good bot , but i am better than every bot :D
Btw gj Hovi :D

night5talker
24th January 2008, 12:46 AM
can any1 make some user manual :D
thanks :D

Anomandaris
1st February 2008, 12:23 AM
Hello

Due to recent change in server, old Osiris has stopped working properly.
Download new version here (it has also some new features check it out)

Some major changes:
- new icons
- you can configure colors in chat window easy now

Dryas
1st February 2008, 02:41 AM
Hovi n Anom thnks alot. I did manage at the first time unbelieavebly :)

I wann ask , how our banned nick list ( nearly 1200 nicks ) can be added in oiris ban list ? I only see preferences here.

thnks.

dryas.

IOwnYouAll
1st February 2008, 10:43 AM
hovi = anom or?

anyway thanks for the new bot :)

SaladFingerPL
1st February 2008, 06:05 PM
Hovi is Hovi, Anom is Anomandaris, aka [BoS]Anomander

Scofield862
1st February 2008, 08:17 PM
slt a tous

Hovi
2nd February 2008, 01:46 AM
Yes it is possible to add those nicks, you must create group of banned users and then add users to it, either by editing xml files or by commands. Feel free to ask me on msn.

Becko0
2nd February 2008, 12:04 PM
This bot owns great job

IOwnYouAll
14th February 2008, 11:02 PM
Hovi , can you please create a list of tags which can be used in the bot .xml?

10x in advance ;)

Hovi
14th February 2008, 11:40 PM
Hey, check out "DTD" directory in settings, it contains dtd files, dtd files are definitions of xml files, they exactly define what tags, attributes are possible in xml files. Check it out.

Enjoy :)

-Hovi-

[RO]Claudiu
6th March 2008, 05:04 AM
you guys did a very good job . it has better graphics than topaz but not so many options.

if you could insert the topaz menu into this program it would be great .

also i dont like the letters fonts i wish i could change the fonts and the size of the text :)

Hovi
6th March 2008, 10:15 AM
CLAUDIU;735778']you guys did a very good job . it has better graphics than topaz but not so many options.

if you could insert the topaz menu into this program it would be great .

also i dont like the letters fonts i wish i could change the fonts and the size of the text :)

You actually can change colors, size, fonts, everything, its defined in external css file.

Trubka
6th March 2008, 10:47 AM
Yeah... nice program...

[RO]Claudiu
6th March 2008, 01:48 PM
damn error :)

dgavril
21st March 2008, 01:19 PM
Hello

Due to recent change in server, old Osiris has stopped working properly.
Download new version here (it has also some new features check it out)

Some major changes:
- new icons
- you can configure colors in chat window easy now

it doesnt work

Josh_lopes
21st March 2008, 01:22 PM
Use topaz its the same thing ;)

EDIT: Ah its working... lol nice u just need configure BOT.xml in settings open in notepad and make the changes like

<username>PUTHERE</username>
<password>PUTPASS</password>
<channel>PUTCHANNEL</channel>

and its over the other settings already are done ;)

Btw u can make one programm to configure that in the first time you open that ;)

gl and gj

doomguard88
12th May 2008, 10:12 PM
Here is what i found..

Generally the bot is great but i noticed this but i don't know if its a bug

normally the bot window look like this

http://i245.photobucket.com/albums/gg68/doomguard88/bug3.jpg

but occasionally for some milliseconds this happens

http://i245.photobucket.com/albums/gg68/doomguard88/bug4.jpg

without me leaving the channel the user list just disappears and reappears ina matter of milliseconds.

It could my comp or my internet i don't know.I just thought i would report i case it is a bug..

Very good job overall...

Edit: I think this happens when there more user in a channel that the bot's window height can fit. Then when a new user joins channel the list tries to refresh and it disappears and reloads..

h4x0rz88
19th May 2008, 04:23 PM
2008.05.19 15:15:52 core.Log severe
SEVERE: AccessSettings can't create Document: Error on line 1 of document file:/C:/Documents%20and%20Settings/XPPRESP3/Desktop/MyBot: Content is not allowed in prolog.

Doesnt work, that shows in core log. Any command i give it or responses dont work at all, how can i make a channel/clan moderator like N0TD bot maybe with more functions but im interested in !g and !o commands.

Hovi
19th May 2008, 04:27 PM
Post your xml files and we will check it for you.

h4x0rz88
31st May 2008, 11:34 AM
ok, i fixed that with making an accessfile.xml. but how do i make advanced commands? like when someone swears it kicks him? bot still doesnt respond


and altough its registering users to the core file it doesnt make ANY text in accessfile, i must add everyone with the access handler manualy or and how the h3ll do i do that? XDDD

damirex
24th June 2008, 11:28 PM
Ok this is maybe stupid question but whatever.

How can i control this bot when i put him in chhanel i place my bot Name and pass in xml file and save it then i connect bot to chhanel then i log in with my account and i see bot in chhanel but how can i control him i don't have clue :S ?
im using Osiris_0_231 latest i think..

Ilaas
31st July 2008, 03:29 PM
does someone know a bot that can host ?(Not only dota)

LifeDrainer[RO]
31st July 2008, 04:03 PM
except lainethlite/ghost there is no other bot who can host...and ghost/lain can host only dota

Perito
31st July 2008, 06:34 PM
whisper to your bot

[RO]Claudiu
5th August 2008, 12:31 AM
someone should modify the attachment in the first post ....... people get that version and get confused ...... they dont bother to read the rest .....

ive also attached the latest version of the bot to this post ....

h4x0rz88
6th August 2008, 03:10 AM
;817337']except lainethlite/ghost there is no other bot who can host...and ghost/lain can host only dota

Not true, you have tons, but only few work on PvPGNs. GHost (LainEthLite), SuperHost (from MegaBlue) or self(more or less)-made ones.

ontopic: I find Osiris much harder to set up then to modify ie. GHosts code and make a moderation/host bot myself!

Ogi.
24th August 2008, 07:55 AM
lolololol what a post ;D;D;D hahahh=]]]
gj mickey!!!1! :):):):):):)

Hovi
13th September 2008, 01:35 PM
http://www.eurobattle.net/showthread.php?t=78616

[SetoKaiba]
13th September 2008, 05:59 PM
I have proposal for command /where <nick>. If that person is offline it just writes "user is offline". I think that it would be better to write "last seen on DD:MM:YY". And is it posible to see players clans in channel.

Anomandaris
14th September 2008, 12:08 AM
It's impossible to make any of these. Osiris is only client, and things u talk about depends more or less from battle.net.

LuCkYbg
8th November 2008, 08:12 PM
Hmmm i have a problem i get Osiris_0_231 I logged in with my bot but how to use it what is the commands i didnt touch anything and where to change the comands ????

ss-darky
30th December 2008, 05:43 AM
i dl osiris 231 but when i try to run it a console app pops up then closes at the same time? i'm guessing it's some king of bug which won't let the bot start. i'm running vista x64 is this the prob?

this is the error msg in the console: javaw is not recognised as an internal or external command.

i have jre and jdk installed so what is wrong? is it vista 64 or what?

Anomandaris
30th December 2008, 03:12 PM
Try to run version 1.0.1 posted here:
http://www.eurobattle.net/showthread.php?t=78459

Also attach or copy in post core.log file, this way we would know what's going on.

We have never tested it on vista.

Taz.
30th December 2008, 09:32 PM
I have vista, i use osiris. Works great,until were a part, it freezes and i need to close it by force..

ss-darky
31st December 2008, 01:28 PM
DarkM;907515']i dl osiris 231 but when i try to run it a console app pops up then closes at the same time? i'm guessing it's some king of bug which won't let the bot start. i'm running vista x64 is this the prob?

this is the error msg in the console: javaw is not recognised as an internal or external command.

i have jre and jdk installed so what is wrong? is it vista 64 or what?

i managed to get it working. just that it crashes sometimes but works ok usually.

Faeron
4th January 2009, 01:33 AM
firstly Hovi n Anom thnks a lot :)

i m TR-AntiHack Team member n TR channel operator..i ve tried osiris this night and i think that we wont use topazchat anymore...
i have a question that is how can we use osiris for anti flood r spam...i ve tried for 2-3 hours but didnt it...

if we make it, we can handle TR channel very easy..ty for your help :)

Hovi
8th January 2009, 12:38 AM
For new versions please refer to:

http://www.eurobattle.net/showthread.php?t=78459

#OP3N
12th January 2009, 06:45 PM
nice work :)

S[Y]L
29th January 2009, 11:03 PM
Is there any possibility of recompiling the bot so it works with JRE 1.5? :) Or if someone has any instructions on how to do it myself, I've had no luck in search so far.

Anomandaris
30th January 2009, 03:04 PM
L;921956']Is there any possibility of recompiling the bot so it works with JRE 1.5? :) Or if someone has any instructions on how to do it myself, I've had no luck in search so far.

It's impossible. Osiris uses syntax and classes introduced in java 1.6 and it would require some changes in code to make it 1.5 compatible. Sorry, but all I can do, is to encourage you to install JRE 1.6...

S[Y]L
31st January 2009, 05:19 PM
It's impossible. Osiris uses syntax and classes introduced in java 1.6 and it would require some changes in code to make it 1.5 compatible. Sorry, but all I can do, is to encourage you to install JRE 1.6...

It's not up to me, otherwise I would have done it already :). But thanks for your reply, at least I know it most likely isn't worth the hassle to make it 1.5 compatible.

h4x0rz88
2nd March 2009, 11:46 PM
Well I used Osiris for a few weeks and got a few suggestions, ordered by importance (for my usage, my perspective):


Automatic connect on startup (every bot listed or being able to set which.)
Readme.txt file (detailed info so you wont get bothered on MSN :D )
More open-sourced (if you agree with it)
Example configs included in .rar (the n0td ones, which are quite a good example rahter then the ones included already!)

LuDa_KinG
14th March 2009, 08:57 PM
I downloaded the bot, but it doesn't connect :S
Any help maybe ?

phaNtom
15th March 2009, 12:04 AM
You need to put your bot info(nick/pass of acc ingame), simply "create the bot" (bot=acc that will connect on the server).

Use server.eurobattle.net and ur nicks' acc/pass, set that realm, 6112 port and gg.

LuDa_KinG
15th March 2009, 01:10 PM
Well thank you alot :D, it works now great !
The issue was that i wrote eurobattle.net instead of server.eurobattle.net :)

phaNtom
15th March 2009, 06:45 PM
Have fun using it ;)

LuDa_KinG
18th March 2009, 04:44 PM
Hello,again !
I wanna use the Osiris bot as a channel guard for my clan channel but i don't see there any option, all what i can see is only preferences :S
I'll be very greatfull if somebody could help me

LuDa_KinG
20th March 2009, 04:13 PM
Hmm any help here :S ?

h4x0rz88
22nd March 2009, 11:42 PM
Well good luck with that - here are some of my .xml configuration files. Its for [TeBR]BOT in clan TeBR channel. ATM I am using a GHost++ based my own channel bot which I am writing the code myself out of GHost++ base.

Only 2 xml files - 1 is for the settings/access , 1 is for the settings/bot

Thats the example, there are a LOT of handlers, some test handlers, some uncomplete ones but no documentation how to use them.

LuDa_KinG
24th March 2009, 03:03 PM
Oh thnx alot :)
But i need more help from you,to explain it to me a lil bit better:D if u got time and if im not getting on your nervs :P

h4x0rz88
24th March 2009, 11:21 PM
Come to meh channel, I was busy right now setting up Guest OSes & studying...

Also think about what exactly do you need...

LuDa_KinG
25th March 2009, 01:41 PM
Ok,i thought about what i want for my bot.
I want not much,just:The handler that the bot whisps to the ppl that join the channel like a welcome message :),than he should be abble to kick/ban and if u can some funn stuf like u did on your tebrbot(the slap command that was mega LOL)

Ty.

R0ck_WaRlord
7th April 2009, 02:45 PM
How can I make handler for my .xml files ?
And if you can help me with a xml tutorial for osiris(<?xml version="1.0" encoding="UTF-8"?>), I will be gladly to learn it.

h4x0rz88
29th April 2009, 08:21 AM
If you're asking about access.xml and bot.xml, I uploaded a example that explains a lot of things.

Writing handlers yourself is currently unavailable as the source isn't available, maybe Anomandaris/Hovi/Firebird will update it in a while but I am sure they have other things, more important things, to do.

Hovi
29th April 2009, 09:44 AM
If you're asking about access.xml and bot.xml, I uploaded a example that explains a lot of things.

Writing handlers yourself is currently unavailable as the source isn't available, maybe Anomandaris/Hovi/Firebird will update it in a while but I am sure they have other things, more important things, to do.

Hello, I thinks it actually is possible even without knowing the source (which I think isn't secret anyway, just try to ask Ano for it). Osiris itself is a jar library.

If you want to write your own handler, you just have to extend class core.handler.AbstractHandler and implement some of the methods that you need.

I am attaching source code of AbstractHandler itself (it is quite documented) and one example implementation.


package core.handler;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

import core.Bot;
import core.bo.message.InMessage;
import core.bo.message.OutMessage;
import core.bo.message.UserFlag;
import core.bo.message.OutMessage.Flag;
import core.event.AccessEvent;
import core.event.AccessListener;
import core.event.BotStateEvent;
import core.event.BotStateListener;
import core.event.MessageEvent;
import core.event.MessageListener;
import core.handler.info.HandlerInfo;

/**
* Super class for all handlers.
* Each class that wan't to extend AbstractHandler should have two constructors:
* () (standard constructor with no arguments
* - create instance of handler that will be used only retrive handler's info via getHandlerInfo method
* (Bot, Map<String, String>)
* - create fully working instance of handler, that will receive events from given bot and with given options
* Input for handlers are methods from listeners messageReceived and stateChanged,
* but handlers can use set of method that are called by default for bot input.
* Output for handlers are sendXxx method defined in AbstractHandler class
*
*/
public abstract class AbstractHandler implements MessageListener, BotStateListener, AccessListener {

/**
* Parent bot given in constructor
*/
protected Bot c_bot;
/**
* Map with options (optionName -> optionValue)
*/
protected Map<String, String> c_options;

protected void user(String m_user, EnumSet<UserFlag> m_flags, String m_client) {}
/**
* Method that is automatically triggered when user enters channel.
* @param m_user Name of entering user.
* @param m_flags Flag of entering user
* @param m_client Chat client of user.
*/
protected void join(String m_user, EnumSet<UserFlag> m_flags, String m_client){}
/**
* Method that is automatically triggered when user leaves channel.
* @param m_user Name of leaving user.
* @param m_flags Flag of leaving user
*/
protected void leave(String m_user, EnumSet<UserFlag> m_flags){}
/**
* Method that is automatically triggered when user receives whisper message.
* @param m_user Name of user that sent the message.
* @param m_flags Flag of user that sent the message.
* @param m_message Received message.
*/
protected void whisperReceived(String m_user, EnumSet<UserFlag> m_flags, String m_message) {}
/**
* Method that is automatically triggered when user sends whisper message.
* @param m_user Name of user that received the message.
* @param m_flags Flag of user that received the message.
* @param m_message Sent message.
*/
protected void whisperSent(String m_user, EnumSet<UserFlag> m_flags, String m_message){}
/**
* Method that is automatically triggered when any whisper message happends.
* @param m_user Name of user that sent/received the message.
* @param m_flags Flag of user that sent/received the message.
* @param m_message Sent/received message.
*/

protected void whisper(String m_user, EnumSet<UserFlag> m_flags, String m_message){}
/**
* Method that is automatically triggered, when someon talks in channel.
* @param m_user Name of user talking.
* @param m_flags User's flag.
* @param m_message Message that he said.
*/
protected void talk(String m_user, EnumSet<UserFlag> m_flags, String m_message){}
/**
* Method is automatically triggered when an admin says an announcement.
* @param m_message Message of the announcement.
*/

protected void announcement(String m_message){}
/**
* Methos is automatically triggered when channel changes.
* @param m_name Name of new channel.
*/
protected void channelChange(String m_name){}
/**
* Method is automatically triggered when flags of a user change.
* @param m_user Name of user.
* @param m_flags New flags status.
*/
protected void flagChange(String m_user, EnumSet<UserFlag> m_flags){}
/**
* Info message - most of input, that can't fit anywhere else.
* @param m_message Info message.
*/
protected void info(String m_message){}
/**
* Message is automatically triggered when error message is received.
* @param m_message Error message.
*/
protected void error(String m_message){}
/**
* Method that is automatically triggered, when someon talks in channel using /me command.
* @param m_user Name of user talking.
* @param m_flags User's flag.
* @param m_message Message that he said.
*/
protected void emote(String m_user, EnumSet<UserFlag> m_flags, String m_message){}
protected void name(String m_name){}
/**
* Method that is automatically triggered, whenever bot gets any input.
* @param m_input Whole input, not parsed.
*/
protected void defaultParse(InMessage m_input){}

/**
* Create new handler ready to return handler's info
*/
public AbstractHandler() {
}

public void playerAdded(AccessEvent e) {
}

public void playerRemoved(AccessEvent e) {
}

public void playerRenamed(AccessEvent e) {
}


/**
* Create new handler with m_bot parent and empty option map
* @param m_bot
*/
public AbstractHandler(Bot m_bot) {
this(m_bot, new HashMap<String, String>());
}

/**
* Create new handler with given options and m_bot
* @param m_bot Instance of Bot associated with this handler.
* @param m_options Map of options set in bot xml file.
*/
public AbstractHandler(Bot m_bot, Map<String, String> m_options){
c_bot = m_bot;
c_options = m_options;
}

/**
* This function is called, whenever any text is send to server
* By default it does nothing
*/
public void messageSend(MessageEvent l_event) {
}

/**
* This method is called whenever any server messsage is received.
* By default does nothing.
*/
public void serverMessageReceived(MessageEvent e) {
}

/**
* This function is called whenever bot receive any input from server.
* If not overwritten it calls parseIntput method for message text.
*/
public void messageReceived(MessageEvent l_event){
parseMessage((InMessage)l_event.getMessage());
}



/**
* @param m_name Name of option.
* @param m_default Default value, if option not found.
* @return option value if there is value with given m_name, m_default otherwise
*/
protected String getOption(String m_name, String m_default) {
String l_str;
return (l_str = c_options.get(m_name)) == null ? m_default : l_str;
}

/**
*
* @param m_name
* @param m_default
* @return
*/
protected int getIntegerOption(String m_name, int m_default) {
try {
return Integer.parseInt(getOption(m_name, "" + m_default));
} catch(NumberFormatException e) {
return m_default;
}
}

protected long getLongOption(String m_name, long m_default) {
try {
return Long.parseLong(getOption(m_name, "" + m_default));
} catch(NumberFormatException e) {
return m_default;
}
}

protected float getFloatOption(String m_name, float m_default) {
try {
return Float.parseFloat(getOption(m_name, "" + m_default));
} catch(NumberFormatException e) {
return m_default;
}
}

/**
* This function is called whenever bot changes its state.
* Default method does nothing.
*/
public void stateChanged(BotStateEvent e) {}

/**
* This method parses input string and calls: first defaultParse method,
* then appropriate method for given input
* @param m_input Unparsed input.
*/
public void parseMessage(InMessage msg){
defaultParse(msg);
switch (msg.getMessageID()){
case USER: //is here
user(msg.getUser(), msg.getFlag(), msg.getClient());
break;
case JOIN:
join(msg.getUser(), msg.getFlag(), msg.getClient());
break;
case LEAVE:
leave(msg.getUser(), msg.getFlag());
break;
case WHISPER_RECEIVE:
whisper(msg.getUser(), msg.getFlag(), msg.getMessage());
whisperReceived(msg.getUser(), msg.getFlag(), msg.getMessage());
break;
case TALK:
talk(msg.getUser(), msg.getFlag(), msg.getMessage());
break;
case BROADCAST:
announcement(msg.getMessage());
break;
case CHANNEL:
channelChange(msg.getChannel());
break;
case USER_FLAG: //flag change
flagChange(msg.getUser(), msg.getFlag());
break;
case WHISPER_SEND:
whisper(msg.getUser(), msg.getFlag(), msg.getMessage());
whisperSent(msg.getUser(), msg.getFlag(), msg.getMessage());
break;
case INFO:
info(msg.getMessage());
break;
case ERROR:
error(msg.getMessage());
break;
case EMOTE: //emote (/me)
emote(msg.getUser(), msg.getFlag(), msg.getMessage());
case NAME:
name(msg.getMessage());
break;
}
}


/**
* Send message to server with average priority
* @param value Message to send.
*/
public void send (String value) {
c_bot.send(value, "", OutMessage.Priority.AVERAGE, EnumSet.noneOf(Flag.class));
}

/**
* Send message to server at once. This method should be use only by login handler.
* If used by other handlers can break login process or cause message to be lost due to quota
* @param value Message to send.
*/
public void sendAtOnce(String value) {
c_bot.send(value, "", OutMessage.Priority.AT_ONCE, EnumSet.noneOf(Flag.class));
}

/**
* Send message to server with high priority
* @param value Message to send.
*/
public void sendHigh(String value) {
c_bot.send(value, "", OutMessage.Priority.HIGH, EnumSet.noneOf(Flag.class));
}

/**
* Send message to server with low priority
* @param value Message to send.
*/
public void sendLow(String value) {
c_bot.send(value, "", OutMessage.Priority.LOW, EnumSet.noneOf(Flag.class));
}

/**
* All handlers must implement this function and pass basic information about them here
* @return basic info for this handler
*/
public abstract HandlerInfo getHandlerInfo();
}


And implementation that allows you to play sounds (like ~playsound in topaz):


package handler;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.EnumSet;
import java.util.Map;

import sun.audio.AudioPlayer;
import sun.audio.AudioStream;
import core.Bot;
import core.Log;
import core.bo.message.UserFlag;
import core.handler.AbstractHandler;
import core.handler.info.HandlerInfo;
import core.handler.info.HandlerOption;

/**
* This handler will play sound in response to given command
* options available:
* command (default ~playsound) - sound will be played in response to this command
* soundsPath (default sounds\) - path where files with sounds to play are located (use / or \ in path)
* onTalk (true|false) (default true) - sounds will be played in response to: talk
* onEmote (true|false) (default false) - emote
* onWhisper (true|false) (default false) - whisper
*/

public class PlaysoundHandler extends AbstractHandler {

private static final String commandOpt = "command";
private static final String pathOpt = "soundsPath";
private static final String onTalkOpt = "onTalk";
private static final String onEmoteOpt = "onEmote";
private static final String onWhisperOpt = "onWhisper";


boolean b_onTalk;
boolean b_onWhisper;
boolean b_onEmote;
String c_command;
String c_path;

public PlaysoundHandler(){
}

public PlaysoundHandler(Bot m_bot, Map<String, String> m_options) {
super(m_bot, m_options);

b_onTalk = getOption(onTalkOpt, "true").equals("true");
b_onEmote = getOption(onEmoteOpt, "false").equals("true");
b_onWhisper =getOption(onWhisperOpt, "true").equals("true");
c_command = getOption(commandOpt, "~playsound");
c_path = getOption(pathOpt, "sounds/");


c_path = c_path.replace('\\', File.separatorChar);
c_path = c_path.replace('/', File.separatorChar);
}

public void talk(String m_user, EnumSet<UserFlag> m_flags, String m_message){
if (b_onTalk && m_message.startsWith(c_command))
playSound(m_message);
}

public void whisperReceived(String m_user, EnumSet<UserFlag> m_flags, String m_message) {
if (b_onWhisper && m_message.startsWith(c_command))
playSound(m_message);
}

public void emote(String m_user, EnumSet<UserFlag> m_flags, String m_message) {
if (b_onEmote && m_message.startsWith(c_command))
playSound(m_message);
}

private void playSound(String m_message) {
try {
Log.getInstance().debug("plaing sound " + m_message);
InputStream in = new FileInputStream(c_path + m_message.split(" ")[1]);
AudioStream as = new AudioStream(in);
AudioPlayer.player.start(as);
} catch (ArrayIndexOutOfBoundsException e) {
Log.getInstance().debug("Play Sound - No filename given " + e.getMessage());
} catch (FileNotFoundException e) {
Log.getInstance().debug("Play Sound - File not found " + e.getMessage());
} catch (IOException e) {
Log.getInstance().debug("Play Sound - IOException " + e.getMessage());
}
}

public HandlerInfo getHandlerInfo() {
HandlerInfo hi = new HandlerInfo(
"Playsound",
"Play sounds in response to command",
false
);

hi.setLongDescription(
"This handler will play sound in response to given command.\n" +
"Sound will be played when \"[command] [filename]\" will be written.\n" +
"[filename] with sound file must exist in specified path.\n"
);
hi.getOptions().add(new HandlerOption(
commandOpt,
"command",
"sound will be played in response to this command",
"~playsound",
HandlerOption.Type.STRING
));
hi.getOptions().add(new HandlerOption(
pathOpt,
"path",
"path where files with sounds to play are located (use / or \\ in path)",
"sounds\\",
HandlerOption.Type.STRING
));
hi.getOptions().add(new HandlerOption(
onTalkOpt,
"on talk",
"sounds will be played in response to talk",
"true",
HandlerOption.Type.BOOLEAN
));
hi.getOptions().add(new HandlerOption(
onWhisperOpt,
"on whisper",
"sounds will be played in response to whisper",
"true",
HandlerOption.Type.BOOLEAN
));
hi.getOptions().add(new HandlerOption(
onEmoteOpt,
"on emote",
"sounds will be played in response to emote",
"true",
HandlerOption.Type.BOOLEAN
));
return hi;
}

}



Enjoy and feel free to ask, development of new handlers will be greatly supported!

h4x0rz88
30th April 2009, 01:50 AM
Thank you Hovi, maybe I'll revert from my chat ghost to this if I get the hang of this :> Very educational.

By "the source isn't available" I meant that it wasn't posted here or in a SVN I know about, sorry about the miss-information.

blaco
7th June 2009, 02:09 PM
humm hi hovi i have a one question !

What's the command trigger ? ! doesnt work.. . doesent work.. - doesent work then what is it ? :))

phaNtom
7th June 2009, 02:33 PM
Command trigger? What doesn't work?

blaco
7th June 2009, 03:12 PM
Command trigger? What doesn't work?

command trigger do you know command trigger ?

phaNtom
7th June 2009, 03:24 PM
I think you mean on "/" ? Example: /time

Is that what you want?

blaco
7th June 2009, 04:56 PM
I think you mean on "/" ? Example: /time

Is that what you want?

no i dont think so but ill check it..

IR_Kobolt
7th June 2009, 05:14 PM
Is there something like a remote interface planned? (perferably TCP)

Ragnaros
23rd July 2009, 02:49 PM
Awwwwh... Seems awesome. Great Job! :happy2:

BlackburnSVK
3rd September 2009, 04:54 PM
Uhm?

debian:/home/mike/osiris# ls -l
total 540
drwxrwxrwx 2 mike mike 4096 2009-09-03 15:40 icons
-rw-rw-rw- 1 mike mike 529553 2008-09-10 18:15 osiris.jar
drwxrwxrwx 5 mike mike 4096 2009-09-03 15:40 settings
drwxrwxrwx 2 mike mike 4096 2009-09-03 15:40 sounds
-rw-rw-rw- 1 mike mike 21 2009-09-03 14:43 start.bat
debian:/home/mike/osiris# bash start.bat
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java :620)
at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader .java:260)
at java.net.URLClassLoader.access$100(URLClassLoader. java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java: 195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 06)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 51)
at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:319)

how to repair it?

kasharis
11th January 2010, 09:43 PM
Nice man Coockie and Coca Cola :D +1
work in first minute if u know how to use notepad ^^

kasharis
11th January 2010, 09:43 PM
Uhm?

debian:/home/mike/osiris# ls -l
total 540
drwxrwxrwx 2 mike mike 4096 2009-09-03 15:40 icons
-rw-rw-rw- 1 mike mike 529553 2008-09-10 18:15 osiris.jar
drwxrwxrwx 5 mike mike 4096 2009-09-03 15:40 settings
drwxrwxrwx 2 mike mike 4096 2009-09-03 15:40 sounds
-rw-rw-rw- 1 mike mike 21 2009-09-03 14:43 start.bat
debian:/home/mike/osiris# bash start.bat
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java :620)
at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader .java:260)
at java.net.URLClassLoader.access$100(URLClassLoader. java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java: 195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 06)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 51)
at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:319)

how to repair it?
New java have? I got same ... yea it was JAVA GET NEW AND IT WILL WORK

VedRomania
24th August 2010, 09:59 PM
Hello,

I`m working on a public project ( w3 bot write in java ) and i need some informations from Osiris.
Someone know where i can find the source code from Osiris ?
A friend tell me that was shared on forum .

Arbalest
22nd October 2010, 10:41 PM
hi guys i've been trying to use osiris on os ubuntu 10.04 ,i couldn't connect it looks like the prob is in creating the xml file if any1 help in here and thx
p.s server : i tried both eurobattle.net and server.eurobattle.net

_Dead_Shoot_
22nd October 2010, 11:39 PM
Hm did you tried installing java from tutorial?If yes then come on server and I will help you :)

Arbalest
22nd October 2010, 11:40 PM
yes i did ,allright thx :)

Vaikiss
7th August 2012, 03:25 PM
i got latest java and it doesnt work for meh :/

EDIT: on my old pc it was working w/o doing anything

on new one it says java not found even tho i have java and java JDK

Vaikiss
8th August 2012, 04:15 PM
bump some halp plix pl0x ?

Cen
8th August 2012, 08:26 PM
I don't know.. sux to be you? :/

Try google for similar java problem. It probably happens to other apps too.

Vaikiss
13th August 2012, 03:29 PM
http://www.youtube.com/watch?v=bFEoMO0pc7k

:D