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 07-21-2007, 07:27 PM
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
How do you make "something" go into a folder (logs)??

Ok I have this script I'm working on and I need some help.
I'm trying to log who does what and I know how, but I don't know how to put it in a text file.
If someone could tell me how I'd be really appreciative.
__________________
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.
Reply With Quote
  #2  
Old 07-21-2007, 07:49 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
PHP Code:
temp.log "Bob used a tool around 9 o'clock";
temp.file2 0;

temp.file.loadstring("path/to/file/name_here.txt");
if (
file.length() > 0) {
  
file2 filefile2 @= "," log;
  
file2.savestring("path/to/file/name_here.txt"0);
}else 
log.savestring("path/to/file/name_here.txt"0); 
didn't test it, but I think it should work

I think there are some in-built ones, will edit post when I find them
E:

PHP Code:
savelog(str)
savelog2(strstr
__________________
Reply With Quote
  #3  
Old 07-21-2007, 08:17 PM
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
Quote:
Originally Posted by Chompy View Post
PHP Code:
savelog(str)
savelog2(strstr
Now answer my question:
What's the str's for?
__________________
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.
Reply With Quote
  #4  
Old 07-21-2007, 08:21 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by Switch View Post
Now answer my question:
What's the str's for?
filename (relative to the logs/ directory), and the text to save to log. Text is automatically timestamped.
ex: savelog2("stafftool.txt", "zomg h4x");
__________________
Reply With Quote
  #5  
Old 07-21-2007, 08:24 PM
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
Quote:
Originally Posted by Inverness View Post
filename (relative to the logs/ directory), and the text to save to log. Text is automatically timestamped.
ex: savelog2("stafftool.txt", "zomg h4x");
ty! you just made my day
__________________
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.
Reply With Quote
  #6  
Old 07-21-2007, 08:24 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
Quote:
Originally Posted by Switch View Post
Now answer my question:
What's the str's for?
PHP Code:
savelog("omg, someone hacked");
// serverside -> logs/ folder
// clientside -> F2 (Dunno if that has changed with V5)

savelog2("banklog.txt""Someone stole all the gralats from the nation bank of Graal.");
// Something like that, serverside only  will save to logs/gralats.txt 
and

not levels/logs/*
but logs/*
__________________
Reply With Quote
  #7  
Old 07-21-2007, 08:29 PM
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
Quote:
Originally Posted by Chompy View Post
PHP Code:
savelog("omg, someone hacked");
// serverside -> logs/ folder
// clientside -> F2 (Dunno if that has changed with V5) 
and

not levels/logs/*
but logs/*
Ok but for the serverside, what file in the logs/ would it save as?
Also, it's the same with v5, just maybe in the Scripts section.

I know it's logs/* silly
__________________
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.
Reply With Quote
  #8  
Old 07-21-2007, 08:31 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
Quote:
Originally Posted by Switch View Post
Ok but for the serverside, what file in the logs/ would it save as?
Also, it's the same with v5, just maybe in the Scripts section.

I know it's logs/* silly
savelog() serverside, hmm, not sure, try it? It saves it into 1 file all the time, logs.txt or something like that
__________________
Reply With Quote
  #9  
Old 07-21-2007, 08:05 PM
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
what's the str for?
__________________
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.
Reply With Quote
  #10  
Old 07-21-2007, 08:07 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Don't mean to hijack your thread or anything... but is there a way to save a log locally to the player's computer?
Reply With Quote
  #11  
Old 07-21-2007, 08:12 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
Quote:
Originally Posted by DustyPorViva View Post
Don't mean to hijack your thread or anything... but is there a way to save a log locally to the player's computer?
you can use loadstring and savestring on clientside and it will save inside graal/scriptfiles/SERVERNAME/
__________________
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 10:33 AM.


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