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-28-2011, 07:48 AM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
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];
  }

__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
  #2  
Old 10-28-2011, 09:18 AM
Mark Sir Link Mark Sir Link is offline
Kevin Azite
Mark Sir Link's Avatar
Join Date: Sep 2005
Posts: 1,489
Mark Sir Link is just really niceMark Sir Link is just really nice
Send a message via AIM to Mark Sir Link
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
Reply With Quote
  #3  
Old 10-28-2011, 11:31 AM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
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.
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
  #4  
Old 10-28-2011, 03:43 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
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.

__________________
Quote:
Reply With Quote
  #5  
Old 10-28-2011, 04:20 PM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
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"
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
  #6  
Old 10-28-2011, 09:49 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Similar to requesthttp. It returns a data object which contains the page source.
__________________
Reply With Quote
  #7  
Old 10-29-2011, 01:55 AM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
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.
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
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 11:28 AM.


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