Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Using the Log in scripts? (https://forums.graalonline.com/forums/showthread.php?t=68653)

Omini 09-10-2006 07:06 PM

Using the Log in scripts?
 
Is it possible to get the text from the log and do something with it? If possible, I'm guessing it'd be a requesttext(,) but I'm not sure. Any help would be appreciated.

Skyld 09-10-2006 07:13 PM

I don't understand what you're trying to do.

Omini 09-10-2006 07:20 PM

I want a script to read the log (F2) and if it reads it starting off with...

"PM: received from"

...it triggers an action.

Skyld 09-10-2006 07:26 PM

Quote:

Originally Posted by Omini
I want a script to read the log (F2) and if it reads it starting off with...

"PM: received from"

...it triggers an action.

It doesn't need to be a requesttext(); since requesttext() is for asking the server for things.

Stefan could probably incorporate functionality for reading from the log window though. If you're looking to detect PMs, there are actual script functions for doing so clientside:
PHP Code:

function onPM(obj)
{
  echo(
format("PM received from %s"obj.account));



Omini 09-10-2006 08:44 PM

Oooh, that's how it's done. =) Thanks. Although incorporating functionality for reading from the log window could be helpful in some cases.

ApothiX 09-11-2006 06:04 PM

I don't think reading directly from the log window would be great, but maybe an event that is triggered every time a message is written to it, ie:

PHP Code:

function onLogWrite(text) {
 
// ...



Admins 09-13-2006 01:22 AM

There is:
PHP Code:

function onLogMessage(msg,colred,colgreen,colblue) {


The F2 window is scripted on Linux/Mac, the same like for the playerlist.

KuJi 09-13-2006 07:59 AM

Quote:

Originally Posted by Stefan
There is:
PHP Code:

function onLogMessage(msg,colred,colgreen,colblue) {


The F2 window is scripted on Linux/Mac, the same like for the playerlist.

Wouldnt the scripted version work for Windows and be possible to disable the older one? Scripted would allow more functionality to it =D?

Skyld 09-13-2006 09:22 AM

Quote:

Originally Posted by KuJi
Wouldnt the scripted version work for Windows and be possible to disable the older one? Scripted would allow more functionality to it =D?

The scripted version would work for Windows, yes, however you would not have it external to the main window. The only thing that is on the scripted playerlist that is not on the Windows one is a feature I added some time ago, called 'Search for Player', where you can search for a nickname by typing in the account name.

ApothiX 09-13-2006 10:59 PM

Quote:

Originally Posted by Stefan
There is:
PHP Code:

function onLogMessage(msg,colred,colgreen,colblue) {


The F2 window is scripted on Linux/Mac, the same like for the playerlist.

Hmm, I thought you told me awhile ago on Debug that it was impossible to change the color of the text outputted to the Log Screen? o_O

Quote:

Originally Posted by Skyld
The scripted version would work for Windows, yes, however you would not have it external to the main window. The only thing that is on the scripted playerlist that is not on the Windows one is a feature I added some time ago, called 'Search for Player', where you can search for a nickname by typing in the account name.

That never seemed to work for me on Linux :(

Skyld 09-13-2006 11:00 PM

Quote:

Originally Posted by ApothiX
That never seemed to work for me on Linux :(

Then I guess you typed an account which was not online, then.


All times are GMT +2. The time now is 10:22 AM.

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