Author Topic: Card Game Scripts  (Read 32156 times)

DocBeat

  • Newbie
  • *
  • Posts: 43
Re: Card Game Scripts
« Reply #15 on: November 19, 2008, 08:40:24 AM »
"After the dealer has been selected, seven cards are dealt to each player, and the top card of the stock is exposed to start the discard pile. If the exposed card has a special ability, it is treated as if the dealer played that card, and the special effect occurs (i.e., skip, draw two, reverse, or wild). If the exposed card is a wild draw four, however, it is returned to the deck and the next card is exposed. Play begins with the person to the left of the dealer, i.e. clockwise"

That's from the UNO rules in the wiki link you posted.Weird i have never played uno that way.Seems like WD4 can't be the first card.

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: Card Game Scripts
« Reply #16 on: November 19, 2008, 09:41:00 AM »
Ok, I did some changes for the first card. Now it act like there's a "dealer" (a person not actually in the game, but his turn is before the first player), and that this dealer puts the first card, so if it's a Draw 2, the first player draws two cards and such.

The script is pretty much done, I just need to test it a bit more, add some kind of !help command, and add a few comments to the code, so that it's a bit easier to modify, in case you want to make some changes to the rules
"I don't know what World War 3 will be fought with, but I know World War 4 with be fought with sticks and stones." - Albert Einstein

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: Card Game Scripts
« Reply #17 on: November 19, 2008, 01:15:20 PM »
A couple small changes again, the playing order is now tha same order that players join the game, because shuffling the order caused some weird problem. Also if there are only 2 players, the reverse card now works as a skip card.

I hope Dark`Star doesn't mind me sharing this screenshot of the game in action (he did win the game after all): http://darkstar.necrolounge.org/shots/2008-11-19_0007.png
"I don't know what World War 3 will be fought with, but I know World War 4 with be fought with sticks and stones." - Albert Einstein

DocBeat

  • Newbie
  • *
  • Posts: 43
Re: Card Game Scripts
« Reply #18 on: November 19, 2008, 04:01:09 PM »
Ok few questions (they don't have to do with the script itself but mostly about the installation).

You installed the script on "Morio" and played as "Moriobot".I know little stuff about irc bots and it seems like i'll have to use one if i want to play using your uno script...or not.

Well one of the things i'd like to know is how the bot  has a different hostmask than yours (as i've noticed almost every time i see a bot and its owner)- does it connect to the server via a proxy?
I was once told to do a research on socket bots to find my answer.Sometimes the hostmask is completely different than the owner's some other times only the less significant part of it is different:

@different.same.same

So what happens?Why would the hostmask be different while both the bot and owner are connecting from the same location using the same chat client & without using a proxy in the case above (cuz if it was a proxy the two hostmasks would be completely different unless the proxy server is of the same ISP same country etc. right?)
Sorry to sound so noobish.

What i had in mind is to load the script in icechat (that would be my bot) and then join the same channel using other chat client so that i can play too (of course i'll have same hostmask  :-( ).
I'll be able to play that way right or is there any easier way  :?

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Card Game Scripts
« Reply #19 on: November 19, 2008, 04:22:14 PM »
You can run the script from your client. The nickname he used is irrelevant. No idea how you think the bot had a different host mask, unless it simply was not authed to Q. All this script is, is running inside IceChat, and connecting to whatever IRC Server and room you wish.

You would not have a different host name, unless you were connecting the two clients from 2 different locations, or you are purposely connecting one through a BNC or whatever.

Now, alot of ppl do not run bots from their own pc's but instead from a Shell Account, thus the totally different host names. But this is not the case with IceChat, as it can not be run from a shell account, as its not really a "bot", it is a client, running some kind of a bot script.

Two totally different things, as its the piece of software that is running and connecting, is what is determined as to if it is really a bot, or just a client, with a script running.

Hope that cleara it up a bit.
The IceChat God

DocBeat

  • Newbie
  • *
  • Posts: 43
Re: Card Game Scripts
« Reply #20 on: November 19, 2008, 06:52:01 PM »
I know the nick moriobot is irrelevant lol.It's just  that so far i have noticed  that all people who have bots (for various tasks in their channel etc.) have different hostmasks from their bots.They must be using irc bouncers right?
And sometimes the hostmask is not totally different:

Bot's Mask:          @ED8BFC99.D3FD7F49.F0258043.IP
Bot Owner's Mask: @AC5144B1.D3FD7F49.F0258043.IP

If i am not mistaken those are called socket bots which i don't know much about.

And as for the Shell Accounts you mentioned that explains me why the bot doesn't disconnect when the owner gets a 'ping timeout'.

Thnx for da help Snerf i can't wait to see Morio's script in downloads section whenever it is ready   :-D

I'm planning to install UNO in icechat and join a channel while the script is running.However,in order to participate in the game i can't be the one with the script running.When the script is loaded in icechat all my connections to servers will be affected by it.So...in order to play i need to connect to the server using another client right?-or is there any other way to do it?

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: Card Game Scripts
« Reply #21 on: November 19, 2008, 10:00:52 PM »
if you are running the script, and want to play the game too, you will have to run multiple instances of icechat.

The script should be ready for download in a couple of days
"I don't know what World War 3 will be fought with, but I know World War 4 with be fought with sticks and stones." - Albert Einstein

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Card Game Scripts
« Reply #22 on: November 19, 2008, 10:40:42 PM »
Those hosts are random ones generated by IRC services, to hide people's IP Addresses.
The IceChat God

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: Card Game Scripts
« Reply #23 on: November 25, 2008, 09:36:19 AM »
The script is finally finished and uploaded to the download section of this site.

If you have any questions about the script, feel free to ask
"I don't know what World War 3 will be fought with, but I know World War 4 with be fought with sticks and stones." - Albert Einstein

A_K1TTEN

  • Newbie
  • *
  • Posts: 15
Re: Card Game Scripts
« Reply #24 on: November 26, 2008, 10:44:25 AM »
alright, well i can get the game to start, get people to join, get the cards delt... but we cant play the cards, haha. we have tried !play y 7, !play 7 y, !play yellow 7, and every combination of that, and cant figure it out... what do we do? OH and we can do all the other commands.

DarkStar

  • Full Member
  • ***
  • Posts: 135
  • Scripts for Praise
    • CorpseCorp
Re: Card Game Scripts
« Reply #25 on: November 26, 2008, 10:48:58 AM »
!play y7, I believe.
This message brought to you by the Wonderful Wizard of Oz.

A_K1TTEN

  • Newbie
  • *
  • Posts: 15
Re: Card Game Scripts
« Reply #26 on: November 26, 2008, 10:50:45 AM »
yup thats it, just after i posted my last post, i figured it out, haha

A_K1TTEN

  • Newbie
  • *
  • Posts: 15
Re: Card Game Scripts
« Reply #27 on: November 26, 2008, 09:18:42 PM »
The script is AWESOME!!! im in a room with 100+ people, and its hectic! haha but tons of fun!

DocBeat

  • Newbie
  • *
  • Posts: 43
Re: Card Game Scripts
« Reply #28 on: December 01, 2008, 04:15:54 AM »
Nice job Morio i enjoyed playing with friends  :-D

DocBeat

  • Newbie
  • *
  • Posts: 43
Re: Card Game Scripts
« Reply #29 on: December 01, 2008, 05:38:18 AM »
Do you think that sometime you will be able to go for a 'draw poker' script?-i'll provide you with the main idea:


For 2-8 players.Players may !join or !quit anytime and they can also change nicks while playing.
When a player joins the game he/she receives a specific amount of money/chips (credits) and five cards.

A deck of 53 cards:
hearts, spades,diamonds and clubs

each suit has 13 cards: 2,3,4,5,6,7,8,9,10,JACK,QUEEN,KING,ACE
(in an order of the weakest to the strongest)
and also a wild joker card which represents any card - the lucky player to have it decides what card it will be.


1)Before the players receive their cards, an ante is placed.The ante: a small compulsory bet is made by all the players.How much credits the ante will be that is up to the creator of the script  :-P

2)Players pick up the cards and look at them and then decide if they wish to stay in the game.
If so, a bet must now be placed.
Once all bets are called the first round of betting is complete.
First betting interval: the player to the dealer's left has the right to !bet first; if he does not bet the other players (always to the left - no left or right in a chatroom  :-P) may bet in turn.

When a player's turn to bet comes the FIRST time of the round he/she has three options:

-To "!call" that bet- this means that they must contribute money into the pot so that their contribution matches the bet placed by the previous player.
-To "!raise" the bet value.
-if they do not feel confident they could "!fold" and drop out of the game (Thus,not contribute any money into the pot, but also lose any chance of winning the pot).

If the bet was raised a player has to !call (bet) for second time and agree with the final bet or !fold (he/she can not !raise it again)

After one or two turns of arranging the bet end the players finally place their credits.

3)Players may now choose to exchange any number of cards from their
hand (0-5). This is known as 'the draw'.Exchanging no cards is known as "stand pat".

4)Once the draw is complete a second round of betting takes place.

5)If all bets are called there is a showdown.
The winner is the player with the highest ranking hand.
If only one player remains (ie. no showdown) they will win the pot without having to
expose their cards.


A player wins the tournament when all other players run out of credits.

notes:
Sometimes in home games there is a limit of cards that players may discard (up to three cards),
but professional games usually let you discard all five.
The wild joker card may not be used (depends on preferences i guess).