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:45:14 am
*
gfx*gfx
gfx
WinMX World :: Forum  |  Metis Scripts and Help  |  Metis Script Help  |  cant get this script to read properly, a little help please
gfx
gfxgfx
 

Author Topic: cant get this script to read properly, a little help please  (Read 1907 times)

0 Members and 1 Guest are viewing this topic.

Offline Mechanic

  • Forum Member
cant get this script to read properly, a little help please
« on: December 10, 2006, 12:39:36 pm »
i was trying to create a script that willl allow members to add info to create a story.  after working on it the script will add and restart but when i try to get it to read the story it will read 1 line and sometime read a second line twice but will not do any more than that.  can someone please help?   it requires 2 text files right now, one that actually has the story and a second one that has the line count for the story.

Code: [Select]
<command type="script">
<in>!readstory</in>
<out type="push" extdata="lines"><operator type="readfile" nvalue="D:\room config\Metis 2.6\Add-Ons\story\lines.txt" lvalue="l" rvalue="1"/></out>
<out type="push" extdata="linecount2">1</out>
<out type="push" extdata="storyf"><operator type="readfile" nvalue="D:\room config\Metis 2.6\Add-Ons\story\story.txt" lvalue="l" rvalue="$linecount2$"/></out>
<out type="push" extdata="linecount2"><operator type="+" lvalue="$linecount2$" rvalue=1/></out>
<out>$storyf$</out>
<out type="goto" condition="2" lvalue="$linecount2$" rvalue="$lines$" extdata="-4"></out>
</command>

<command type="script">
<in>!addstory %PARAMETER%</in>
<out type="push" extdata="lines"><operator type="readfile" nvalue="D:\room config\Metis 2.6\Add-Ons\story\lines.txt" lvalue="l" rvalue="1"/></out>
<out type="push" extdata="lines"><operator type="+" lvalue="$lines$" rvalue="1"/></out>
<out type="file" mode="t" extdata="D:\room config\Metis 2.6\Add-Ons\story\lines.txt">$lines$</out>
<out type="file" mode="a" extdata="D:\room config\Metis 2.6\Add-Ons\story\story.txt">%PARAMETER%\n</out>
<out type="pm" extdata="%RAWNAME%">it has been added</out>
</command>

<OnOpMessage usergroup="MyRoomTopAdmins">
<in>!newstory</in>
<out type="file" mode="t" extdata="D:\room config\Metis 2.6\Add-Ons\story\lines.txt">0</out>
<out type="file" mode="t" extdata="D:\room config\Metis 2.6\Add-Ons\story\story.txt"> </out>
</OnOpMessage>

</config>

Thank you for your help
Mechanic
-->¤ Unlimited Movies and Music ¤<--

Offline Max™

  • MX Hosts
  • *****
  • If Im Not Back later... Wait Longer
    • Maxtech
Re: cant get this script to read properly, a little help please
« Reply #1 on: December 10, 2006, 04:10:19 pm »
ive looked at it, havnt tried it though, but as it has only the 1 <out> on thdstory i may be rong but it could need multi-line <out>'s to show all the lins, but im not sure if that wud show that same 2 lines over & over
Code: [Select]
<in>!readstory</in>
<out type="push" extdata="lines"><operator type="readfile" nvalue="D:\room config\Metis 2.6\Add-Ons\story\lines.txt" lvalue="l" rvalue="1"/></out>
<out type="push" extdata="linecount2">1</out>
<out type="push" extdata="storyf"><operator type="readfile" nvalue="D:\room config\Metis 2.6\Add-Ons\story\story.txt" lvalue="l" rvalue="$linecount2$"/></out>
<out type="push" extdata="linecount2"><operator type="+" lvalue="$linecount2$" rvalue=1/></out>
<out>$storyf$</out>
<out>$storyf$</out> //would this work? i dont know without running a test, i got no other ideas, sorry
<out>$storyf$</out>
<out type="goto" condition="2" lvalue="$linecount2$" rvalue="$lines$" extdata="-4"></out>
</command>



Try Connecting, the attacks may let you  https://patch.winmxconex.com/

Offline Mechanic

  • Forum Member
Re: cant get this script to read properly, a little help please
« Reply #2 on: December 10, 2006, 08:40:25 pm »
well i almost had it going by putting in a couple sleeps but that slowed it to much.  i tried delay and still gave me trouble as well as stepped backward some
Mechanic
-->¤ Unlimited Movies and Music ¤<--

Offline Lagerlout666

  • Forum Member
Re: cant get this script to read properly, a little help please
« Reply #3 on: December 11, 2006, 02:38:05 pm »
Code: [Select]
<OnOpMessage type="script">
<in>!readstory</in>
<out type="push" extdata="directory">D:\room config\Metis 2.6\Add-Ons\story\</out>
<out type="push" extdata="searchlinkline">1</out>
<out type="push" extdata="displayline">0</out>
<out type="push" extdata="searchline"><operator type="readfile" nvalue="$directory$\story.txt" lvalue="l" rvalue="$searchlinkline$"/></out>
<out type="push" extdata="displayline" condition="?" lvalue="$searchline$"><operator type="+" lvalue="$displayline$" rvalue="1"/></out>
<out delay="800" condition="?" lvalue="$searchline$">/opmsg ($displayline$) $searchline$</out>
<out type="push" extdata="searchlinkline"><operator type="+" lvalue="$searchlinkline$" rvalue="1"/></out>
<out type="goto" extdata="-4" condition="!=" lvalue="$searchline$" rvalue=""></out>
<out delay="1500" condition="!=" lvalue="$displayline$" rvalue="0">/opmsg End of Story</out>
<out delay="1500" condition="==" lvalue="$displayline$" rvalue="0">/opmsg Sorry #c1#%NAME%#c51#, no Story to read</out>
</OnOpMessage>

This will read every line from top to bottom in the txt doc story. that should work for you.
The Solution to 99% of winmx problems

nap.winmxgroup.net        -ONLINE again YAY!!!!!! :D

Praise's daily at the church of "Kopimi"

Offline Lagerlout666

  • Forum Member
Re: cant get this script to read properly, a little help please
« Reply #4 on: December 11, 2006, 02:41:10 pm »
Sorry forgot to say and will display each line in a new row on screen so long stories might spam the room abit. i use that part in a script im working on at the mo ill publish it soon. hope it works for you.
The Solution to 99% of winmx problems

nap.winmxgroup.net        -ONLINE again YAY!!!!!! :D

Praise's daily at the church of "Kopimi"

WinMX World :: Forum  |  Metis Scripts and Help  |  Metis Script Help  |  cant get this script to read properly, a little help please
 

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