If we code an RPG bot, I just thought a neat structure.
bot/
|-- core (IRC connection crap)
`-- classes
|-- D&D
|-- Shadowrun
`-- T&T
Something like that. Each type of RPG can be a class we add into it. :)
That would be neat. Then we could have one for dice and things like that.
I don't know how useful that would be.
Just having a bot that can do everything withoua need for those subclasses would be just as useful. Just the ability to roll dice, what more do you want?
I really don't see a point to having a bot/plugin for it.
Quote from: iago on November 20, 2005, 06:45:15 PM
I really don't see a point to having a bot/plugin for it.
If someone takes the time to do it without it delaying anything than I don't really see the problem either. It would be nice to, if we're doing it in irc be able to just type a command and have the bot announce the roll of the channel. some of us don't have crazy dice!
Quote from: Hitmen on November 20, 2005, 09:42:56 PM
Quote from: iago on November 20, 2005, 06:45:15 PM
I really don't see a point to having a bot/plugin for it.
If someone takes the time to do it without it delaying anything than I don't really see the problem either. It would be nice to, if we're doing it in irc be able to just type a command and have the bot announce the roll of the channel. some of us don't have crazy dice!
I'd slap together a program that can roll 6-sided dice locally, then everybody who needs to can run it. I've said that several times already :-P
If somebody really wants to do a bot/plugin, then just make one that can roll dice. Anything else is completely pointless, T&T for example has EXTREMELY simple rules..
lol, well I cant program so you can count me out :-), but yeah just a dice rolling device is good enough for me :-P
I'm pretty inexperienced with C (especially in making network programs). However, if someone wants to team up for a project, I'd be more than willing to help out as much as I can.
I can slap together a PHP web-based version too. I almost think that would work better. Let me know what you guys think.
I'm thinking a Perl-based plugin for xchat. How hard can it be?
Not very hard. =P
Quote from: iago on November 21, 2005, 07:53:30 PM
I'm thinking a Perl-based plugin for xchat. How hard can it be?
That would also work really well.
The reason I was thinking of a web-based one is because it's more accessable. If someone wanted to make a move (or check up on someone's rolls) assuming we ever do a forum based RPG, it would be nice to be able to get to the rolling interface anywhere you can access the web.
I was thinking we could do something like this:
-- Game
`-- Rolling Session
`-- Players
`-- Rolls
That's just me though. I'm really game for anything that works well! :)
Having a plugin running on the GM's system would be idea. Since I intend to use xchat, that's not a problem.
Just a ".roll 3d6" command would be handy.
Newby -- could you implement some plugin in Perl or C that lets you do ".roll 3d6" and it will respond with the dice roll? Once that's done, I can look after getting it to work for T&T stuff :)
Quote from: iago on November 21, 2005, 08:15:30 PM
Having a plugin running on the GM's system would be idea. Since I intend to use xchat, that's not a problem.
Just a ".roll 3d6" command would be handy.
Newby -- could you implement some plugin in Perl or C that lets you do ".roll 3d6" and it will respond with the dice roll? Once that's done, I can look after getting it to work for T&T stuff :)
Alright, I was thinking maybe we were going to do something with the forums, but I'd definitely agree that a xchat plugin would be ideal if we're going to be using it for our game! :)
Quote from: iago on November 21, 2005, 08:15:30 PM
Having a plugin running on the GM's system would be idea. Since I intend to use xchat, that's not a problem.
Just a ".roll 3d6" command would be handy.
Newby -- could you implement some plugin in Perl or C that lets you do ".roll 3d6" and it will respond with the dice roll? Once that's done, I can look after getting it to work for T&T stuff :)
For X-Chat? On it! :)
Uh, 3d6? Or do you want xd6?
If so, I can do .roll xd6, or .roll d6 x...
Otherwise, just 3d6. :)
Quote from: Newby on November 21, 2005, 09:10:01 PM
Quote from: iago on November 21, 2005, 08:15:30 PM
Having a plugin running on the GM's system would be idea. Since I intend to use xchat, that's not a problem.
Just a ".roll 3d6" command would be handy.
Newby -- could you implement some plugin in Perl or C that lets you do ".roll 3d6" and it will respond with the dice roll? Once that's done, I can look after getting it to work for T&T stuff :)
For X-Chat? On it! :)
Uh, 3d6? Or do you want xd6?
If so, I can do .roll xd6, or .roll d6 x...
Otherwise, just 3d6. :)
If you do one that can roll 3, I can look after everything else.
But if you're feeling ambition, then do:
- x d y (x y-sided dice)
- 2d6 doubles-add-roll-over (I mentioned that somewhere else)
- xd6, doubles-add-roll-over (Required if we have a berserker)
Also, I'd like to be able to do a table look up. Like, for example, I want a table of, say, 100 languages. Then they could do:
.choose language
And it would return a random one. But for other things besides languages, like, make sure I can easily expand it.
Of course, I can do all that, as long as you get it rolling 3d6 :P
Quote from: iago on November 21, 2005, 09:15:03 PM
But if you're feeling ambition, then do:
- x d y (x y-sided dice)
- 2d6 doubles-add-roll-over (I mentioned that somewhere else)
- xd6, doubles-add-roll-over (Required if we have a berserker)
Also, I'd like to be able to do a table look up. Like, for example, I want a table of, say, 100 languages. Then they could do:
.choose language
And it would return a random one. But for other things besides languages, like, make sure I can easily expand it.
Well, I can get most of that, but if you wanna do some of the work...
What do you want me to do with the result of the 3d6?
Quote from: Newby on November 21, 2005, 09:19:07 PM
Quote from: iago on November 21, 2005, 09:15:03 PM
But if you're feeling ambition, then do:
- x d y (x y-sided dice)
- 2d6 doubles-add-roll-over (I mentioned that somewhere else)
- xd6, doubles-add-roll-over (Required if we have a berserker)
Also, I'd like to be able to do a table look up. Like, for example, I want a table of, say, 100 languages. Then they could do:
.choose language
And it would return a random one. But for other things besides languages, like, make sure I can easily expand it.
Well, I can get most of that, but if you wanna do some of the work...
What do you want me to do with the result of the 3d6?
Display it out loud.
And I don't WANT to do any work, but I WILL do it if I have to :P
I mean, do you want me to sum them up or just list the individual results (it seems like this one)?
Quote from: Newby on November 21, 2005, 09:19:07 PM
Well, I can get most of that, but if you wanna do some of the work...
What do you want me to do with the result of the 3d6?
Something like this:
Quote
.roll 3d6
You rolled 3 6-sided die: 3, 6, 1
Why not both?
Sum is the most important part, though.
<me> .roll 3d6
<bot> 3 + 6 + 1 = 10
I'll also need you to allow adds and display the level of the 2d6DARO rolls (level 1 is 20, level 2 is 25, level 3 is 30, level 4 is 35, etc:
Let's see if this table looks ok:
Lvl Target Lvl Target Lvl Target Lvl Target
1st 20 2nd 25 3rd 30 4th 35
5th 40 6th 45 7th 50 8th 55
9th 60 10th 65 11th 70 12th 75
13th 80 14th 85 15th 90 16th 95
17th 100 18th 105 19th 110 20th 115
The forumula for level is simple, though: floor((roll - 15) / 5)
The command should look like this:
.daro 12
It will roll 2 dice in the standard way, add 12 to it, and display the level achieved:
<me> .daro 12
<bot> rolled 2 2 + 3 4 + 12 = 23 = level 1
<me> .daro 23
<bot> rolled 1 5 + 23 = 29 = level 2
<me> .daro 17
<bot> rolled 2 2 + 4 4 + 3 3 + 12 = 30 = level 3
Finally, if 1 2 or 2 1 or 3 1 or 1 3 is rolled, it's an auto-fail:
<me> .daro 100
<bot> rolled 2 1 = autofail
<me> .daro 12
<bot> rolled 3 1 = autofail
auto-fail = botch
I hate you. I just worked for a good 2-3 hours working on this fucking script, and you ask for something different?!?!?! >:(
Quote[21:02:51] <@newby_> Result of 4d6 roll: 5 5 5 3
[21:02:58] <+newby__> !roll 3d6
[21:02:58] <@newby_> Result of 3d6 roll: 1 1 3
[21:03:01] <+newby__> !roll 3d6
[21:03:01] <@newby_> Result of 3d6 roll: 1 4 4
[21:03:03] <+newby__> !roll 3d6
[21:03:03] <@newby_> Result of 3d6 roll: 5 6 1
[21:03:06] <+newby__> !roll 4d4
[21:03:06] <@newby_> Result of 4d4 roll: 3 3 2 2
[21:03:10] <+newby__> !roll 100d6
[21:03:10] <@newby_> Result of 100d6 roll: 6 4 1 3 4 5 5 3 5 1 2 4 6 6 1 5 1 4
1 3 3 1 6 3 4 1 2 6 2 1 5 2 6 1 1 5 1 4 5 4 6 3 4 3 2 6 3
2 5 6 3 6 3 1 6 2 1 4 3 4 3 3 1 6 5 2 5 4 5 3 1 6 6 1 3 5
4 6 4 1 3 6 3 6 3 5 2 4 4 1 5 2 5 2 6 2 6 5 4 1
[21:03:13] <+newby__> !roll 69d69
[21:03:14] <@newby_> Result of 69d69 roll: 66 11 52 57 61 50 47 4 27 7 67 57 12
6 34 29 69 52 32 58 39 16 37 40 12 21 13 12 59 34 17 63 69
50 18 28 17 31 8 45 34 4 52 18 58 40 66 69 39 14 6 61 4 67
28 57 26 54 59 13 1 57 52 63 26 13 52 11 51
I refuse to sum them up or do any further work. Blow me. :-*
x86-rpg-script.pl (http://www.newbyproductions.net/downloads/x86-rpg-script.pl)
#!/usr/bin/perl
# Perl script for tunnels and trolls online.
# Contains various script things.
# Written by newby (newbypwns@gmail.com) for iago (iago@valhallalegends.com)
# http://wwww.x86labs.org
# :)
# Register the plugin with X-Chat.
Xchat::register("x86-rpg-script", "0.1a", "RPG script for X-Chat", \&unload);
Xchat::print("3Loading x86-rpg-script... please wait.");
# Register the roll command to a variable.
my $rpghook = Xchat::hook_server("PRIVMSG", "parsetalking");
# Randomize the seed!
srand();
# This sub is called whenever the plugin is unloaded.
sub unload()
{
Xchat::unhook($rpghook);
Xchat::print("3Unloading x86-rpg-script... please wait.");
}
# sub rolldice(int times, int sides)
# Sides: number of sides on the dice
# Times: number of times to roll the dice.
sub rolldice()
{
($times,$sides) = @_;
undef @arrayofnumbers;
for (my $i = 0; $i < ($times); $i++)
{
@arrayofnumbers = (@arrayofnumbers,(int(rand($sides)+1)));;
}
return \@arrayofnumbers;
}
sub parsetalking()
{
my $data = shift(@_);
my $username = substr(shift(@$data), 1);
# Xchat::print("Username: $username");
shift(@$data); # Don't know better.
shift(@$data); # :(!
my $message = substr(join(" ", @$data), 1);
# Xchat::print("Message: $message");
# Xchat::command("say <$username> $message");
# Enter the command sub:
if (substr($message, 0, 1) eq "!")
{
if (lc(shift(@$data)) eq ":!roll") # If not, we lost it. I'll have to assign to a variable later!
{
my $diceroll = lc(shift(@$data));
if (index($diceroll, "d") == -1)
{
Xchat::command("say You didn't enter a real dice value!\n");
return 0;
}
my $times = substr($diceroll, 0, index($diceroll, "d"));
my $sides = substr($diceroll, index($diceroll, "d")+1);
my $resultofdiceroll = &rolldice($times, $sides);
Xchat::command("say Result of $times"."d"."$sides roll: @$resultofdiceroll\n");
}
}
return 0;
}
Newby is just mad because he sucks at life and I kept making fun of him the whole time while he was screwing up.
Actually, most of my anger (my harsh comments in the above post are sarcasm) came out of Perl not having a switch statement?
(I couldn't get mine to work for love 'nor money.)
programing sounds like it could be a hassle and frustrating at times!
Quote from: Toweliex86] link=topic=3840.msg40113#msg40113 date=1132640362]
programing sounds like it could be a hassle and frustrating at times!
I think the entirety of programming is frustrating. -_-
Haha, just kidding. Programming is great, it's an awesome way to learn how to approach/solve problems. :)
Yeah, Newby just has an angry personality :-)
Thanks for writing that, I can look after anything else.
Incidentally, how do I use that?
Put it in ~/.xchat2 and it'll auto load on start!