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 10-14-2009, 12:56 AM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
Finding information from text document

Two questions slightly related:

1. Is there a way to search a text document uploaded in a file to see if it contains information. Like if i want to search the .txt document for guilds to see if an account is in it, and if so, remove it or confirm its there, and if not, add it in?

2. Is there a way to pull specific information from a website into a gui. Forums is one thing I would like to do, but also just pulling a <div class> or something of that sort from a website, and putting the value into the gui.
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #2  
Old 10-14-2009, 04:27 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
loadlines(str) savelines(str, int)
Where str is the file and int is 0 (overwrite) or 1 (append).
They load as an array.
For your guild example:
PHP Code:
function onActionServerside() {
  
temp.guild.loadlines("levels/guilds/guildSexy_Time.txt");
  for (
i=0i<temp.guild.size(); i++) {
    if (
player.account in temp.guild[i].tokenize(":")[0]) {
      
player.chat "I'm in the guild dur.";
      return;
    }
  }
  
temp.guild.add(player.account":" @player.nick);
  
temp.guild.savelines("levels/guilds/guildSexy_Time.txt"0);
  
player.chat "I'm now in (Sexy Time) as " @player.nick".";
}
//#CLIENTSIDE
function onPlayerChats() {
  if (
player.chat == "guild me baby") {
    
triggerserver("gui"this.namenull);
  }

There's also loadstring(str) savestring(str, int) loadvars(str) savevars(str) with the same parameters for the load and save, except ...sting is for a string and ...vars is for variables, so you need to make whatever var you work with a TStaticVar.
http://graal.net/index.php/Creation/...adstring.28.29
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.

Last edited by Switch; 10-14-2009 at 04:37 AM..
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 04:17 AM.


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