PtokaX forum

Lua 5.3/5.2/5.1 Scripts (for PtokaX 0.4.0.0 and newer) => Finished Scripts => Topic started by: ?StIfFLEr?? on 18 January, 2009, 07:51:16

Title: Chess Game
Post by: ?StIfFLEr?? on 18 January, 2009, 07:51:16
Actually i found a chess script in the archived forum can anyone convert it to new api or make a similar game script so ass to add a new game in the list so that users can enjoy playing it.
the link for the script
http://forum.ptokax.org/index.php?topic=1807.0
Actually m still not aware of how the members post a perfect link to the desired location so please excuse me for the mistake.
It would be great if anyone can provide with their help.
Thanks in advance.
Title: Re: Chess Game
Post by: ?StIfFLEr?? on 19 January, 2009, 09:05:57
Is there anyone who can help me with this game script.
Title: Re: Chess Game
Post by: Madman on 19 January, 2009, 12:45:06
I can't even download it...
And i can't create one, since i do not play chess...
Title: Re: Chess Game
Post by: ?StIfFLEr?? on 19 January, 2009, 15:22:24
I have the .rar file of this game can anyone help in uploading it into this forum.
I am unaware about how to upload files.
Title: Re: Chess Game
Post by: CrazyGuy on 19 January, 2009, 16:06:29
When you write a post, click on + Additional Options... under where you write and select Choose with Attach
Title: Re: Chess Game
Post by: HyperT3nsion on 19 January, 2009, 17:54:30
hehe...
i also couldn't download
it...
but i want to try it...
must be good
Title: Re: Chess Game
Post by: ?StIfFLEr?? on 20 January, 2009, 11:07:44
Thanks a lot crazy guy and thanks a lot mutor for uploading the file.
Please can some look into the script and convert it for new API.
Thanks in advance.
Title: Re: Chess Game
Post by: ?StIfFLEr?? on 22 January, 2009, 04:19:08
Anyone there who can help out making this script for new api.
Title: Re: Chess Game
Post by: Madman on 22 January, 2009, 09:15:24
Quote from: †StIfFLEr†™ on 22 January, 2009, 04:19:08
Anyone there who can help out making this script for new api.

Take it easy...
I'm thinking about doing it... but i'm a busy little boy...
So it will take time.
Title: Re: Chess Game
Post by: ?StIfFLEr?? on 22 January, 2009, 09:51:56
thanks a lot madman will be waiting eagerly for your reply.
Title: Re: Chess Game
Post by: Madman on 26 January, 2009, 18:22:47
V.012 attached to my post.
I only converted it, I have no idea if it works.
Atlest it did not fail on start.

Changelog can be found in rar.

Let me know about any bugs.
Do not ask for features.
The TODO list in the changelog is not mine, it's chill, and will there for not be done if/untill chill works on this script again
Title: Re: Chess Game
Post by: Madman on 31 January, 2009, 00:10:09
now cmds works, and game shows proper version.
Title: Re: Chess Game
Post by: WhiteKnuckles on 08 February, 2009, 01:04:26
I tried it out and it did not matter which command you gave, it always gave the help in return.  Consequently could not start a game.
I am running Ptoka 0.4.1.1

Quote from: Madman on 31 January, 2009, 00:10:09
now cmds works, and game shows proper version.
Title: Re: Chess Game
Post by: CrazyGuy on 08 February, 2009, 02:29:39
File: RasChess.V.013.lua
Function ToArrival

On quick count the string.sub is off, so let's remove it by changing

local pmmsg = string.sub(data,(18+string.len(RasChess.botname)+2*string.len(curUser.sNick)),(string.len(data)-1))
local _,_,word1 = string.find(string.lower(pmmsg),"^%p(%S+)")


to

local _,_,word1 = data:find("%b<>%s%p(%S+)|")
Title: Re: Chess Game
Post by: Madman on 08 February, 2009, 12:12:55
That would stop the chatting...
I never bother to check those lines... will fix something that works...
Even tho, i got the cmds to work before, they don't now :/

*Edit*
But i'm to tierd and hungover to fix this now apperently...
Title: Re: Chess Game
Post by: Madman on 08 February, 2009, 16:49:52
Feeling better now =)

Uploaded V.014

V.014 : 08.02.09
- Hopefullt fixed cmds, works for me again
- Changed ToArrivals parsing


i managed to invite/quit/chat and set font
Title: Re: Chess Game
Post by: Madman on 10 February, 2009, 19:05:53
uhm...
miss by me or users...
it's useing prefixes now. so it's not invite USER it's !invite USER
Title: Re: Chess Game
Post by: Madman on 14 February, 2009, 07:47:57
Another bug fix edition...

Hopefully this should be the last...
Title: Re: Chess Game
Post by: Madman on 15 February, 2009, 17:56:19
another version with bugfixes...

V.016 : 15.02.09
- Removed in no way relevent test code
- Fixed missing endpipe in RC
- Fixed so all profiles get RC
- Fixed missing prefix in help and rc
- All above reported by Hungarista
- Escaped spaces and $, whined by CrazyGuy
Title: Re: Chess Game
Post by: WhiteKnuckles on 19 February, 2009, 12:43:31
Still does not seem to be right.
I can't invite another player.  The script gives an error on line 118 regarding a null value.
Title: Re: Chess Game
Post by: Madman on 20 February, 2009, 06:27:41

V.017 : 20.02.09
- Fixed pmmsg nil error, reported by sevral users
- Added check for inviteing yourself


Yes, i finnaly fixed the pmmsg nil error. Atlest i belive so. It was just something i realized yesterday.
Hungarista's uses [HUN]Hungarista in the hub we are in, so maybe he does at other places.
So i tried the script with a prefix, and then i got the nil error.

And WhiteKnuckles next time, don't just say it gives a nil error, paste the error msg.
This time you where lucky, there was only one thing that could go nil on line 118, and the fact it's allready been reported properly.
Title: Re: Chess Game
Post by: WhiteKnuckles on 20 February, 2009, 15:12:52
Thanks for the conversion of this script Madman.  I have just tried v0.17 and no longer get the error described before but now when I try to invite anyone I get the following message:
FAILED to invite: <user>, Reasons: User is not online, User is playing a game, You are playing a game, or it's your name.

None of those reasons are true.
I used the right click on the username then "Play Chess with User" option when I came up with this problem.


//Edit by CrazyGuy: removed quote (waste of space)
Title: Re: Chess Game
Post by: Madman on 20 February, 2009, 22:28:04

V.018 : 20.02.09
- Fixed check for inviteing yourself
Title: Re: Chess Game
Post by: ?StIfFLEr?? on 24 February, 2009, 14:54:25
thanks a lot madman .
sorry for late reply was out for a while.
Thanks a lot once again.