gfxgfx
 
Please login or register.

Login with username, password and session length
 
gfx gfx
gfx
76774 Posts in 13500 Topics by 1651 Members - Latest Member: insider4ever April 19, 2024, 04:57:46 am
*
gfx*gfx
gfx
WinMX World :: Forum  |  Metis Scripts and Help  |  Games  |  Connect
gfx
gfxgfx
 

Author Topic: Connect  (Read 3503 times)

0 Members and 1 Guest are viewing this topic.

Offline F£¥è®

  • Forum Member
Connect
« on: September 22, 2007, 10:34:18 am »
Based on the popular connect 4 game
http://freewebs.com/flyermal/connect1.xml right click and save taget as
OS Microsoft® Windows Vista™ Home Premium, Processor Intel(R) Core(TM)2 Quad CPU  Q8200  @ 2.33GHz, 2331 Mhz, 4 Core(s), 4 Logical Processor(s), Installed Physical Memory (RAM) 6.00 GB

Offline gypsyroadhog

  • Forum Member
Re: Connect
« Reply #1 on: November 20, 2007, 05:12:52 pm »
Hi
A very good game indeed....is it possible to add a counter that remembers user names wins and losses?
If so could some one give the coding please...very similar to the Blackjack game.
I always think people like to know how they are getting on.
Hope some one can help  :lol:

Offline reef

  • WMW Volunteer
  • *****
  • ***
Re: Connect
« Reply #2 on: November 21, 2007, 12:05:21 am »
If you scroll down near the bottom of the script you
see these lines:

Code: [Select]
<command type="script">
<in>winner!</in>
<out>/notice &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#c10#Well Done #c12#%USERVAR[702]% #c10#You Got Four In A Row</out>
<out type="self">finish!</out>
</command>

<command type="script">
<in>winner2!</in>
<out>/notice &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#c10#Sorry #c12#%USERVAR[702]% #c10#You Lost To %BOTNAME%</out>
<out type="self">finish!</out>
</command>

Change them to:

Code: [Select]
<command type="script">
<in>winner!</in>
<out>/notice &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#c10#Well Done #c12#%USERVAR[702]% #c10#You Got Four In A Row</out>
<out type="self">finish!</out>
<out type="self">!c4win! %USERVAR[702]%</out>
</command>

<command type="script">
<in>winner2!</in>
<out>/notice &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#c10#Sorry #c12#%USERVAR[702]% #c10#You Lost To %BOTNAME%</out>
<out type="self">finish!</out>
<out type="self">!c4loss! %USERVAR[702]%</out>
</command>

Now add this bit just above the </config> line:

Code: [Select]
<command type="script">
<in>!c4win! %USERVAR[702]%</in>
<out type="push" extdata="name">%USERVAR[702]%</out>
<out type="push" extdata="currentnumber"><operator type="readfile" nvalue="C:\Program Files\RoboMX 2.80\Plugins\C4 Scoring\c4wincounter.txt" lvalue="c" rvalue="-1"/></out>
<out type="push" extdata="newcount"><operator type="+" lvalue="$currentnumber$" rvalue="1"/></out>
<out>#c4#You are Winner number #c1#$newcount$ #c4#in Connect4</out>
<out type="file" mode="t" extdata="C:\Program Files\RoboMX 2.80\Plugins\C4 Scoring\c4wincounter.txt">$newcount$</out>
<out type="push" extdata="currentwinner"><operator type="readfile" nvalue="C:\Program Files\RoboMX 2.80\Plugins\C4 Scoring\$name$c4wins.txt" lvalue="c" rvalue="-1"/></out>
<out type="push" extdata="currentloser"><operator type="readfile" nvalue="C:\Program Files\RoboMX 2.80\Plugins\C4 Scoring\$name$c4loss.txt" lvalue="c" rvalue="-1"/></out>
<out type="push" extdata="currentwinner"><operator type="+" lvalue="$currentwinner$"rvalue="1"/></out>
<out type="file" mode="t" extdata="C:\Program Files\RoboMX 2.80\Plugins\C4 Scoring\$name$c4wins.txt">$currentwinner$</out>
<out type="normal">#c1#Your CONNECT 4 Stats:  &nbsp;&nbsp;&nbsp;#c4#Wins #c1#$currentwinner$  &nbsp;&nbsp;&nbsp;&nbsp;#c8#Losses #c1#$currentloser$</out>
<out type="pop" extdata="702"/>
</command>

<command type="script">
<in>!c4loss! %USERVAR[702]%</in>
<out type="push" extdata="name">%USERVAR[702]%</out>
<out type="push" extdata="currentnumber"><operator type="readfile" nvalue="C:\Program Files\RoboMX 2.80\Plugins\C4 Scoring\c4losecount.txt" lvalue="c" rvalue="-1"/></out>
<out type="push" extdata="newcount"><operator type="+" lvalue="$currentnumber$" rvalue="1"/></out>
<out>#c8#You are Loser number #c1#$newcount$ #c8#in Connect4</out>
<out type="file" mode="t" extdata="C:\Program Files\RoboMX 2.80\Plugins\C4 Scoring\c4losecount.txt">$newcount$</out>
<out type="push" extdata="currentloser"><operator type="readfile" nvalue="C:\Program Files\RoboMX 2.80\Plugins\C4 Scoring\$name$c4loss.txt" lvalue="c" rvalue="-1"/></out>
<out type="push" extdata="currentwinner"><operator type="readfile" nvalue="C:\Program Files\RoboMX 2.80\Plugins\C4 Scoring\$name$c4wins.txt" lvalue="c" rvalue="-1"/></out>
<out type="push" extdata="currentloser"><operator type="+" lvalue="$currentloser$"rvalue="1"/></out>
<out type="file" mode="t" extdata="C:\Program Files\RoboMX 2.80\Plugins\C4 Scoring\$name$c4loss.txt">$currentloser$</out>
<out type="normal">#c1#Your CONNECT 4 Stats:  &nbsp;&nbsp;&nbsp;#c4#Wins #c1#$currentwinner$  &nbsp;&nbsp;&nbsp;&nbsp;#c8#Losses #c1#$currentloser$</out>
<out type="pop" extdata="702"/>
</command>

<command type="script">
<in>!myc4score</in>
<out type="push" extdata="name">%NAME%</out>
<out type="push" extdata="currentwinner"><operator type="readfile" nvalue="C:\Program Files\RoboMX 2.80\Plugins\C4 Scoring\$name$c4wins.txt" lvalue="c" rvalue="-1"/></out>
<out type="push" extdata="currentloser"><operator type="readfile" nvalue="C:\Program Files\RoboMX 2.80\Plugins\C4 Scoring\$name$c4loss.txt" lvalue="c" rvalue="-1"/></out>
<out type="normal">#c1#Your CONNECT 4 Stats:  &nbsp;&nbsp;&nbsp;#c4#Wins #c1#$currentwinner$  &nbsp;&nbsp;&nbsp;&nbsp;#c8#Losses #c1#$currentloser$</out>
<out type="pop" extdata="702"/>
</command>

Create a new folder named C4 Scoring in Plugins or Add-Ons (depending on which version of metis your using) and change the file paths in the script
to match your own.

This will count the total amount of wins and losses by all players
along with scoring wins and losses for each user individually.
can also view your score when game is inactive by typing !myc4score

I've only tested this briefly and it seemed to work fine... good luck,hope it works for ya

And thanks flyer it's a cool game.... lookin forward to more of yer games  :)

Offline F£¥è®

  • Forum Member
Re: Connect
« Reply #3 on: November 21, 2007, 12:10:55 pm »
Nice add on piece of script reef,I haven't tried it but it looks like it should work fine.
Too busy on other projects at the moment but hopefully I will get back to doing some Metis scripting in the very near future.
Cheers and tyvm  :D.
OS Microsoft® Windows Vista™ Home Premium, Processor Intel(R) Core(TM)2 Quad CPU  Q8200  @ 2.33GHz, 2331 Mhz, 4 Core(s), 4 Logical Processor(s), Installed Physical Memory (RAM) 6.00 GB

Offline gypsyroadhog

  • Forum Member
Re: Connect
« Reply #4 on: November 21, 2007, 12:31:12 pm »
Thanks Reef
Thats excelent and just what i wanted, i will try it out later :D
When you say change file path.....is that for what youve added above or must it be done for the entire script?

Offline gypsyroadhog

  • Forum Member
Re: Connect
« Reply #5 on: November 21, 2007, 02:33:52 pm »
Its ok thanks
the script works beautifully....thanks again Reef :lol:

Offline reef

  • WMW Volunteer
  • *****
  • ***
Re: Connect
« Reply #6 on: November 22, 2007, 02:48:27 am »
your welcome.... glad it works for ya    :)

Offline ace202

  • Forum Member
Re: Connect
« Reply #7 on: February 12, 2008, 09:11:24 pm »
Nice script, i in fact posted a query on a scorer similiar to this. I have a few queries though. Does the scorer not store ASCII names, i've just had a bit of a hiccup with that.  Nice script reef.

-Cheers.

Offline reef

  • WMW Volunteer
  • *****
  • ***
Re: Connect
« Reply #8 on: February 13, 2008, 12:42:09 am »
I just wanna make it clear this isnt my script... the game was made by flyer i just added a way to add scoring.

And for the scoring to handle certain characters in names you would need something like whats below.I'm sure theres better ways of doin it but i'm no pro and this works in other games i've added scoring too so it should work for this game as well.

Replace the current scoring sections of the script with this and change the file paths to match yours.

*only gave this a few runs in my room and seemed to work fine*

Code: [Select]
<command type="script">
<in>!c4win1! %USERVAR[702]%</in>
<out type="push" extdata="name">%USERVAR[702]%</out>
<out type="push" extdata="name"><operator type="strrem" lvalue="$name$" rvalue=" "/>$name$</out>
<out type="push" extdata="name"><operator type="strrem" lvalue="$name$" rvalue="<"/></out>
<out type="push" extdata="name"><operator type="strrem" lvalue="$name$" rvalue=">"/></out>
<out type="push" extdata="name"><operator type="strrem" lvalue="$name$" rvalue=":"/></out>
<out type="push" extdata="name"><operator type="strrem" lvalue="$name$" rvalue="!"/></out>
<out type="push" extdata="name"><operator type="strrem" lvalue="$name$" rvalue="/"/></out>
<out type="push" extdata="name"><operator type="strrem" lvalue="$name$" rvalue="\"/></out>
<out type="push" extdata="name"><operator type="strrem" lvalue="$name$" rvalue='"'/></out>
<out type="push" extdata="name"><operator type="strrem" lvalue="$name$" rvalue="|"/></out>
<out type="push" extdata="name"><operator type="strrem" lvalue="$name$" rvalue="."/></out>
<out type="push" extdata="name"><operator type="strrem" lvalue="$name$" rvalue="?"/></out>
<out type="push" extdata="name"><operator type="strrep" nvalue="$name$" lvalue=&amp; rvalue="-"/></out>
<out type="push" extdata="name"><operator type="strrep" nvalue="$name$" lvalue=&lowast; rvalue="-"/></out>
<out type="push" extdata="name"><operator type="strrep" nvalue="$name$" lvalue=&perc; rvalue="-"/></out>
<out type="push" extdata="name"><operator type="strrep" nvalue="$name$" lvalue=&quote; rvalue="-"/></out>
<out type="push" extdata="currentnumber"><operator type="readfile" nvalue="C:\Program Files\RoboMX\Plugins\C4 Scoring\c4wincounter.txt" lvalue="c" rvalue="-1"/></out>
<out type="push" extdata="newcount"><operator type="+" lvalue="$currentnumber$" rvalue="1"/></out>
<out>/notice &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#c10#You are Winner number #c6#»» #c1#$newcount$ #c6#«« #c10#in #c26#CONNECT4</out>
<out> </out>
<out type="file" mode="t" extdata="C:\Program Files\RoboMX\Plugins\C4 Scoring\c4wincounter.txt">$newcount$</out>
<out type="push" extdata="currentwinner"><operator type="readfile" nvalue="C:\Program Files\RoboMX\Plugins\C4 Scoring\$name$c4wins.txt" lvalue="c" rvalue="-1"/></out>
<out type="push" extdata="currentloser"><operator type="readfile" nvalue="C:\Program Files\RoboMX\Plugins\C4 Scoring\$name$c4loss.txt" lvalue="c" rvalue="-1"/></out>
<out type="push" extdata="currentwinner"><operator type="+" lvalue="$currentwinner$"rvalue="1"/></out>
<out type="file" mode="t" extdata="C:\Program Files\RoboMX\Plugins\C4 Scoring\$name$c4wins.txt">$currentwinner$</out>
<out type="normal">/notice &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#c1#Your CONNECT 4 Stats:  &nbsp;&nbsp;&nbsp;#c4#Wins #c1#$currentwinner$  &nbsp;&nbsp;&nbsp;&nbsp;#c8#Losses #c1#$currentloser$</out>
<out type="pop" extdata="702"/>
</command>

<command type="script">
<in>!c4loss1! %USERVAR[702]%</in>
<out type="push" extdata="name">%USERVAR[702]%</out>
<out type="push" extdata="name"><operator type="strrem" lvalue="$name$" rvalue=" "/>$name$</out>
<out type="push" extdata="name"><operator type="strrem" lvalue="$name$" rvalue="<"/></out>
<out type="push" extdata="name"><operator type="strrem" lvalue="$name$" rvalue=">"/></out>
<out type="push" extdata="name"><operator type="strrem" lvalue="$name$" rvalue=":"/></out>
<out type="push" extdata="name"><operator type="strrem" lvalue="$name$" rvalue="!"/></out>
<out type="push" extdata="name"><operator type="strrem" lvalue="$name$" rvalue="/"/></out>
<out type="push" extdata="name"><operator type="strrem" lvalue="$name$" rvalue="\"/></out>
<out type="push" extdata="name"><operator type="strrem" lvalue="$name$" rvalue='"'/></out>
<out type="push" extdata="name"><operator type="strrem" lvalue="$name$" rvalue="|"/></out>
<out type="push" extdata="name"><operator type="strrem" lvalue="$name$" rvalue="."/></out>
<out type="push" extdata="name"><operator type="strrem" lvalue="$name$" rvalue="?"/></out>
<out type="push" extdata="name"><operator type="strrep" nvalue="$name$" lvalue=&amp; rvalue="-"/></out>
<out type="push" extdata="name"><operator type="strrep" nvalue="$name$" lvalue=&lowast; rvalue="-"/></out>
<out type="push" extdata="name"><operator type="strrep" nvalue="$name$" lvalue=&perc; rvalue="-"/></out>
<out type="push" extdata="name"><operator type="strrep" nvalue="$name$" lvalue=&quote; rvalue="-"/></out>
<out type="push" extdata="currentnumber"><operator type="readfile" nvalue="C:\Program Files\RoboMX\Plugins\C4 Scoring\c4losecount.txt" lvalue="c" rvalue="-1"/></out>
<out type="push" extdata="newcount"><operator type="+" lvalue="$currentnumber$" rvalue="1"/></out>
<out>/notice &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#c8#You are Loser number #c21#»» #c8#$newcount$ #c21#«« #c8#in #c26#CONNECT4</out>
<out> </out>
<out type="file" mode="t" extdata="C:\Program Files\RoboMX\Plugins\C4 Scoring\c4losecount.txt">$newcount$</out>
<out type="push" extdata="currentloser"><operator type="readfile" nvalue="C:\Program Files\RoboMX\Plugins\C4 Scoring\$name$c4loss.txt" lvalue="c" rvalue="-1"/></out>
<out type="push" extdata="currentwinner"><operator type="readfile" nvalue="C:\Program Files\RoboMX\Plugins\C4 Scoring\$name$c4wins.txt" lvalue="c" rvalue="-1"/></out>
<out type="push" extdata="currentloser"><operator type="+" lvalue="$currentloser$"rvalue="1"/></out>
<out type="file" mode="t" extdata="C:\Program Files\RoboMX\Plugins\C4 Scoring\$name$c4loss.txt">$currentloser$</out>
<out type="normal">/notice &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#c1#Your CONNECT 4 Stats:  &nbsp;&nbsp;&nbsp;#c4#Wins #c1#$currentwinner$  &nbsp;&nbsp;&nbsp;&nbsp;#c8#Losses #c1#$currentloser$</out>
<out type="pop" extdata="702"/>
</command>

<command type="script">
<in>!myc4score1</in>
<out type="push" extdata="name">%NAME%</out>
<out type="push" extdata="name"><operator type="strrem" lvalue="$name$" rvalue=" "/>$name$</out>
<out type="push" extdata="name"><operator type="strrem" lvalue="$name$" rvalue="<"/></out>
<out type="push" extdata="name"><operator type="strrem" lvalue="$name$" rvalue=">"/></out>
<out type="push" extdata="name"><operator type="strrem" lvalue="$name$" rvalue=":"/></out>
<out type="push" extdata="name"><operator type="strrem" lvalue="$name$" rvalue="!"/></out>
<out type="push" extdata="name"><operator type="strrem" lvalue="$name$" rvalue="/"/></out>
<out type="push" extdata="name"><operator type="strrem" lvalue="$name$" rvalue="\"/></out>
<out type="push" extdata="name"><operator type="strrem" lvalue="$name$" rvalue='"'/></out>
<out type="push" extdata="name"><operator type="strrem" lvalue="$name$" rvalue="|"/></out>
<out type="push" extdata="name"><operator type="strrem" lvalue="$name$" rvalue="."/></out>
<out type="push" extdata="name"><operator type="strrem" lvalue="$name$" rvalue="?"/></out>
<out type="push" extdata="name"><operator type="strrep" nvalue="$name$" lvalue=&amp; rvalue="-"/></out>
<out type="push" extdata="name"><operator type="strrep" nvalue="$name$" lvalue=&lowast; rvalue="-"/></out>
<out type="push" extdata="name"><operator type="strrep" nvalue="$name$" lvalue=&perc; rvalue="-"/></out>
<out type="push" extdata="name"><operator type="strrep" nvalue="$name$" lvalue=&quote; rvalue="-"/></out>
<out type="push" extdata="currentwinner"><operator type="readfile" nvalue="C:\Program Files\RoboMX\Plugins\C4 Scoring\$name$c4wins.txt" lvalue="c" rvalue="-1"/></out>
<out type="push" extdata="currentloser"><operator type="readfile" nvalue="C:\Program Files\RoboMX\Plugins\C4 Scoring\$name$c4loss.txt" lvalue="c" rvalue="-1"/></out>
<out type="normal">/notice &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#c1#Your CONNECT 4 Stats:  &nbsp;&nbsp;&nbsp;#c4#Wins #c1#$currentwinner$  &nbsp;&nbsp;&nbsp;&nbsp;#c8#Losses #c1#$currentloser$</out>
<out type="pop" extdata="702"/>
</command>

Offline Røçkåfë££ë® §kåñK

  • WANABE WINMX CHAT SERVER HACKER
  • Forum Member
    • The Rebelion
Re: Connect
« Reply #9 on: February 13, 2008, 07:13:39 pm »
Perhaps creating 1 .txt file with the users name/ip followed by the win info then look up each line in the .txt file until you reach a blank, if blank then no previous data, if the line contains their name/ip then pull the line out edit the info using operators e.g. strrfind for " "(space) then strright would be my suggestion, then it avoid 10 million .txt files and the extra folder
[ìíÍIí¯Iì·´¯ìÍ]Íì•íÌí¯`·íI¯ìIÌì í]¡í¯ìIÎ Røçkåfë££ë® §kåñK ÎIí¯ì¡[ì íÍIí¯Iì·´¯ìÍì•íÌ[Ìí¯`·íI¯ìIÌìí]

WinMX World :: Forum  |  Metis Scripts and Help  |  Games  |  Connect
 

gfxgfx
gfx
©2005-2024 WinMXWorld.com. All Rights Reserved.
SMF 2.0.19 | SMF © 2021, Simple Machines | Terms and Policies
Page created in 0.02 seconds with 24 queries.
Helios Multi © Bloc
gfx
Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!