Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-10-2006, 07:06 PM
Omini Omini is offline
Millenium Owner
Join Date: Feb 2006
Location: N.Ireland
Posts: 293
Omini is on a distinguished road
Send a message via AIM to Omini Send a message via MSN to Omini Send a message via Yahoo to Omini
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.
__________________



Reply With Quote
  #2  
Old 09-10-2006, 07:13 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
I don't understand what you're trying to do.
Reply With Quote
  #3  
Old 09-10-2006, 07:20 PM
Omini Omini is offline
Millenium Owner
Join Date: Feb 2006
Location: N.Ireland
Posts: 293
Omini is on a distinguished road
Send a message via AIM to Omini Send a message via MSN to Omini Send a message via Yahoo to 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.
__________________



Reply With Quote
  #4  
Old 09-10-2006, 07:26 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
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));

Reply With Quote
  #5  
Old 09-10-2006, 08:44 PM
Omini Omini is offline
Millenium Owner
Join Date: Feb 2006
Location: N.Ireland
Posts: 293
Omini is on a distinguished road
Send a message via AIM to Omini Send a message via MSN to Omini Send a message via Yahoo to Omini
Oooh, that's how it's done. =) Thanks. Although incorporating functionality for reading from the log window could be helpful in some cases.
__________________



Reply With Quote
  #6  
Old 09-11-2006, 06:04 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
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) {
 
// ...

__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #7  
Old 09-13-2006, 01:22 AM
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
There is:
PHP Code:
function onLogMessage(msg,colred,colgreen,colblue) {

The F2 window is scripted on Linux/Mac, the same like for the playerlist.
Reply With Quote
  #8  
Old 09-13-2006, 07:59 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
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?
Reply With Quote
  #9  
Old 09-13-2006, 09:22 AM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
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.
Reply With Quote
  #10  
Old 09-13-2006, 10:59 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
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
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #11  
Old 09-13-2006, 11:00 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
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.
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 10:01 AM.


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