Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-09-2012, 09:39 PM
iBeatz iBeatz is offline
Kavan
iBeatz's Avatar
Join Date: Dec 2010
Location: Northern Ireland, UK
Posts: 154
iBeatz will become famous soon enough
Send a message via Yahoo to iBeatz
Problem with loading string?

For my script, I'm reading the contents of a text file and displaying it in a GUI.
However, for some bizzare reason, I can only load the contents of the text file using loadlines(). If I try loadstring(), it will not work. It won't even echo the second time at all.

PHP Code:
function onActionGetNews(){
  
  
temp.l.loadlines("levels/server_news.txt");
  echo(
"Lines: "@temp.l);
  
temp.s.loadstring("levels/server_news.txt");
  echo(
"String: "@temp.s);

Before you ask, the npcserver already has rw levels/*
__________________

Intelligence without ambition is like a bird without wings.

Reply With Quote
  #2  
Old 01-09-2012, 11:04 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
It's probably not displaying due to a line break: echo(temp.s.length()); to verify that.
__________________
Quote:
Reply With Quote
  #3  
Old 01-09-2012, 11:07 PM
iBeatz iBeatz is offline
Kavan
iBeatz's Avatar
Join Date: Dec 2010
Location: Northern Ireland, UK
Posts: 154
iBeatz will become famous soon enough
Send a message via Yahoo to iBeatz
Quote:
Originally Posted by fowlplay4 View Post
It's probably not displaying due to a line break: echo(temp.s.length()); to verify that.
That echoes 20.
You're saying you can't load it as a string if it contains a line break?
__________________

Intelligence without ambition is like a bird without wings.

Reply With Quote
  #4  
Old 01-09-2012, 11:13 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by iBeatz View Post
That echoes 20.
You're saying you can't load it as a string if it contains a line break?
I'm saying RC won't echo it. Consider sending it via PM to your RC.
__________________
Quote:
Reply With Quote
  #5  
Old 01-09-2012, 11:59 PM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
Quote:
Originally Posted by fowlplay4 View Post
I'm saying RC won't echo it. Consider sending it via PM to your RC.
You can also replace "\n" with "\r" if you REALLY want to echo.
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:15 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.