Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-10-2006, 11:28 PM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
loadlines

I'm trying to use loadlines to make a kind of web browser for txt files in the folder "levels/sites/account_pagename.txt"

I don't really know quite what I'm doing though, and this is just returning 0:
PHP Code:
function onActionServerSide() {
  if (
params[0] == "loadpage") {
    
findPlayer(params[1]);
    
a.client.browserview.loadLines("sites/"@params[1]@"_"@params[2]@".txt");
    
sendtorc("Testing browser: "@a.clientr.browserview);
  }

For testing purposes, params[1] is the account and params[2] is mainweb. So it should be looking up "levels/sites/coreys_mainweb.txt" which does exist. It is:
NPC Code:
<center><h1>Vash-Aniki</h1></center>



I've tried both levels/sites/ and just sites/. Neither have worked.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #2  
Old 12-10-2006, 11:38 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
I dunno about this, but your loading a.client.browserview, and tries
to echo a.clientr.browserview,

also, a is made into an object by using findplayer, so, it would make:
player's client.browserview into the lines that loadlines load.. I'm guessing thats what you are doing,
but the only thing I see, is that you echo the wrong object
__________________
Reply With Quote
  #3  
Old 12-10-2006, 11:47 PM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
I managed to get it to load right, and a sendtorc() displays it right, but MLTextCtrl is just returning 0.
PHP Code:
function loadPage(acc,page) {
  
triggeraction(0,0,"serverside",name,"loadpage",acc,page);
  if (
client.browserview.size() < 2View.text client.broswerview[0];
  else {
    
Browser.View.text NULL;
    for (
i=0i<client.browserview.size(); i++) {
      
View.text View.text SPC client.browserview[i];
    }
  }

__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #4  
Old 12-10-2006, 11:50 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
When I am changing gui attrs outside the control, or destroying, I usually
do like ( @ parent_gui).destroy();

Just a question, inside MLTextCtrl, you are you using client. etc..?
have you tried to set the client file to a thiso. string and load it as thiso.*?
__________________
Reply With Quote
  #5  
Old 12-11-2006, 03:59 PM
contiga contiga is offline
Graal2001 Administration
contiga's Avatar
Join Date: Jul 2004
Location: Netherlands
Posts: 419
contiga is an unknown quantity at this point
Send a message via ICQ to contiga Send a message via AIM to contiga Send a message via MSN to contiga Send a message via Yahoo to contiga
Quote:
Originally Posted by coreys View Post
I'm trying to use loadlines to make a kind of web browser for txt files in the folder "levels/sites/account_pagename.txt"

I don't really know quite what I'm doing though, and this is just returning 0:
PHP Code:
function onActionServerSide() {
  if (
params[0] == "loadpage") {
    
findPlayer(params[1]);
    
a.client.browserview.loadLines("sites/"@params[1]@"_"@params[2]@".txt");
    
sendtorc("Testing browser: "@a.clientr.browserview);
  }

For testing purposes, params[1] is the account and params[2] is mainweb. So it should be looking up "levels/sites/coreys_mainweb.txt" which does exist. It is:
NPC Code:
<center><h1>Vash-Aniki</h1></center>



I've tried both levels/sites/ and just sites/. Neither have worked.
PHP Code:
function onActionServerSideactionp1p2) {
  switch ( 
action) {
    case 
"loadpage":
      
pl findPlayerp1);
      
temp.lines.loadLines"levels/sites/" pl.account "_" p2 ".txt");
      
pl.client.browserview temp.lines;
      echo( 
pl.client.browserview);
      break;
  }

__________________
AIM: Contiga122
MSN: [email protected]
Status:
Quote:
Originally Posted by unixmad View Post
I am also awake 3AM to help correct problems.
Quote:
Originally Posted by Bomy Island RC people
Daniel: HoudiniMan is a bad guy =p
*Bell: rofl. I first read that as houdini is a bad man. like the little kid that wants his mommy to keep her away from that boogie man
Daniel: xD
*Rufus: I wouldn't want my kids around him.
Reply With Quote
  #6  
Old 12-12-2006, 10:25 PM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
It's returning 0 in the echo...o.o

I checked the file with /find...its there...o.o
I don't get it o.o whats wrong? I've tried loadstring() too, that doesn't appear to even do anything...doesn't even return 0.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #7  
Old 12-12-2006, 10:36 PM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Hmmm...weird I tested loadlines() with a gmap in a different folder...it worked then.

But for some reason loadstring() just doesn't work.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #8  
Old 12-12-2006, 10:47 PM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
(triple post, yeah)
Ah, I got it to work. =)

Of course, with loadlines, now it'll completely butcher the data in the file whenever theres break (as in someone hit enter) or theres a comma. =/
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #9  
Old 12-12-2006, 10:48 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Make sure you are accessing the right file by script, echo the filename. Also in your clientside code you have written client.broswerview once, that spelling needs to be fixed.
Reply With Quote
  #10  
Old 12-13-2006, 12:01 AM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by Stefan View Post
Make sure you are accessing the right file by script, echo the filename. Also in your clientside code you have written client.broswerview once, that spelling needs to be fixed.
Quote:
Originally Posted by coreys View Post
I managed to get it to load right, and a sendtorc() displays it right, but MLTextCtrl is just returning 0.
PHP Code:
function loadPage(acc,page) {
  
triggeraction(0,0,"serverside",name,"loadpage",acc,page);
  if (
client.browserview.size() < 2View.text client.broswerview[0]; <- here
  
else {
    
Browser.View.text NULL;
    for (
i=0i<client.browserview.size(); i++) {
      
View.text View.text SPC client.browserview[i];
    }
  }

hmm?
__________________
Reply With Quote
Reply


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 12:21 AM.


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