Thread: Thin Client
View Single Post
  #1  
Old 02-27-2018, 12:25 PM
bushman77
Hill Giant
 
Join Date: May 2003
Location: In the bush
Posts: 129
Default Thin Client

Been playing around with some server studies and i stumbled on to something of interest?

Ive created a simple perl script which posts a site and returns only the variable which stores the server response. (the webserver type does not matter only needs to be configured with a custom route to accept requests from this script (in this case it is a POST request).
The server then can then respond with a string embedded with perl commands

test.pl:
Code:
sub EVENT_SAY {
  if ($text=~/hail/i) {
    use strict;
    use warnings;
    use LWP::UserAgent;
    
    my $url = 'http://localhost:4000/api';
    my $ua       = LWP::UserAgent->new();
    my $response = $ua->post( $url, { 'player' => $name, 'npcid' => 105 } );
    my $content  = $response->decoded_content();
    $content;
   }
}
Found out i can change quests on the fly without needing to issue #reloadquest
Could even use it for character transfers between servers easily aswell
Reply With Quote