Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Regarding Openurl (https://forums.graalonline.com/forums/showthread.php?t=134264903)

Gunderak 10-28-2011 07:48 AM

Regarding Openurl
 
is there anyway to use OpenURL inside the game?
Maybe like setting up cbk1994's web server to communicate with the servers requested and download a html file of it?
or maybe even some kind of serverside functionality like this?
PHP Code:

function onActionServerSide() {
  if (
params[0] == "getdata") {
    
temp.data openurl("http://www.google.com");
    
triggerclient("weapon"this.name"receive"data);
  }
}

//#CLIENTSIDE
function onCreated() {
  
CreateGui();
}

function 
CreateGui() {
  new 
GuiScrollCtrl("Data_Handler") {
    
profile GuiBlueScrollProfile;
    
screenwidth width 2;
    
screenheight height 2;
    
width 250;
    
height 100;
    
hScrollBar "dynamic";
    
vScrollBar "alwaysOn";

    new 
GuiMLTextCtrl("Data") {
      
profile GuiBlueMLTextProfile;
      
0;
      
0;
      
width 250;
      
height 80;
      
text "Loading Data From Server...";
    }
  }
}

function 
onActionClientSide() {
  if (
params[0] == "receive") {
    
Data.text params[1];
  }



Mark Sir Link 10-28-2011 09:18 AM

you can requesturl a given site and then create a script to interpret all the scripts you'd possibly encounter, or search for the thread on GUIBrowserCtrl and ask Stefan to implement that

Gunderak 10-28-2011 11:31 AM

Your first idea sounds like a good one, how would I get the data returned in a huge lump using requestURL?
the rest I reckon I could take care of.

fowlplay4 10-28-2011 03:43 PM

You can use requesturl on the client-side.

PHP Code:

//#CLIENTSIDE

function onCreated() {
  
temp.req requesturl("http://www.google.com");
  
this.catchevent(temp.req"onReceiveData""onSiteDownloaded");
}

function 
onSiteDownloaded(obj) {
  echo(
"Site Data Size: " obj.fulldata.length());
  
// Full data will contain the html data and so on.



Gunderak 10-28-2011 04:20 PM

I want to pay you money to be my personal assistant!
May I ask how this works clientside? I would of thought it would have to of been serverside.
but Thanks!
"You must spread some reputation around before giving it to fowlplay4 again"

cbk1994 10-28-2011 09:49 PM

Similar to requesthttp. It returns a data object which contains the page source.

Gunderak 10-29-2011 01:55 AM

ah ok, I see now.
May I ask how you would set up some type of formatting tool using a multiline GUI.
Say for instance the HTML page contained <whatever>abcd</whatever> which made abcd in bold or something.
Is there any way to make it format it properly?
I thought I would be able to, but it turns out it is alot harder than I thought it would be.


All times are GMT +2. The time now is 02:54 AM.

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