Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Accessing data from login2 (https://forums.graalonline.com/forums/showthread.php?t=134262496)

sssssssssss 03-21-2011 07:45 PM

Accessing data from login2
 
I'd imagine it takes trust from stefan and permission, but this is what I'd need to translate specific global guild info per players request on a server correct? Is there any info on this stuff?

xAndrewx 03-21-2011 07:56 PM

You can request some stuff, i.e.
HTML Code:

  temp.response = sendListerRequest("checkguildexists", temp.gName);
  if (temp.response[1][1] == true) {
    player.sendMessageBox(N_("That gang name can't be created, it exists on Graal already. Contact an admin if you're the owner of this gang."));
    return false;
  }

etc, research this stuff

Skyld 03-21-2011 08:32 PM

Quote:

Originally Posted by xAndrewx (Post 1638034)
You can request some stuff, i.e.
HTML Code:

  temp.response = sendListerRequest("checkguildexists", temp.gName);
  if (temp.response[1][1] == true) {
    player.sendMessageBox(N_("That gang name can't be created, it exists on Graal already. Contact an admin if you're the owner of this gang."));
    return false;
  }

etc, research this stuff

As far as I know, sendListerRequest is not a built-in function. You would need to sendtext("lister", ...) and then get the result from onReceiveText.

sssssssssss 03-21-2011 08:39 PM

Thanks yall. :)

xAndrewx 03-21-2011 08:48 PM

Oh yeah, we made this together at skyld haha

HTML Code:

function sendListerRequest(temp.option, temp.params) {
  sendtext("lister", temp.option, temp.params);
 
  if (waitfor(this, "ReceiveText", 15)) {
    if (params[0] == "lister") {
      temp.returndata = params;
      temp.returndata.delete(0);
     
      return temp.returndata;
    }
     
    return false;
  }
 
  return false;
}


sssssssssss 03-21-2011 09:42 PM

Im probably going to end up asking this later so I'll just ask now. Is there a way to communicate with the server that guilds are stored on to send and recieve info. Of coarse, rights and such still applying. I just don't know where to even start which is why I'm asking.

xAndrewx 03-22-2011 09:21 AM

Here are some links

http://wiki.graal.net/index.php/Crea...v/Graal_v4_IRC
This explains how to use sendText

http://forums.graalonline.com/forums...hp?t=134258222
A list of sendText stuff

HTML Code:

sendText( "lister", "checkinguild", { str accountname, str guildname } ); - returns the players nick in the guild and the players guildrank - also returns if the guild is pending !
sendText( "lister", "checkguildexists", str guildname ); - returns true or false if the guildname exists - also returns true if the guild is pending ! 

The only two I can find- but I think these will be all you need ^^

sssssssssss 03-23-2011 01:41 AM

Appreciated. :)

sssssssssss 12-21-2011 02:15 AM

I know this is a pretty old thread now, but I did have more questions.

So to use sendtext, even to just get info on guilds, I have to go through logging in on a dbnpc or wnpc serverside with an ircbot?

fowlplay4 12-21-2011 02:31 AM

Quote:

Originally Posted by sssssssssss (Post 1678885)
So to use sendtext, even to just get info on guilds, I have to go through logging in on a dbnpc or wnpc serverside with an ircbot?

No.

IRCBots just use the sendtext function to communicate in the channel.

sssssssssss 12-21-2011 02:47 AM

I know I'm not getting it, but here's what I got that doesn't work.

Ive simply tried
PHP Code:

player.chat sendText"lister""checkinguild", {findplayer(params[1]),findplayer(params[1]).guild} ); 

in a function im already using serverside, and it just puts "0".

I also tried in that same function putting
PHP Code:

sendText"lister""checkinguild", {findplayer(params[1]),findplayer(params[1]).guild} ); 

then serverside I put
PHP Code:

function onReceiveTexttemp.texttypetemp.textoptiontemp.textlines ) { 
  if (
texttype == "lister") {
    if (
textoption == "checkinguild") {
      
player.chat textlines;
    }
  }


and that doesnt do anything at all. I'm sure the params are correct, because I'm already bringing up other player info in that function, that way.

ffcmike 12-21-2011 02:54 AM

Quote:

Originally Posted by sssssssssss (Post 1678890)
then serverside I put
PHP Code:

function onReceiveTexttemp.texttypetemp.textoptiontemp.textlines ) { 
  if (
texttype == "lister") {
    if (
textoption == "checkinguild") {
      
player.chat textlines;
    }
  }


and that doesnt do anything at all. I'm sure the params are correct, because I'm already bringing up other player info in that function, that way.

There is no player object for the event, you should use echo(textlines); instead to ensure it's working.

fowlplay4 12-21-2011 02:56 AM

There won't be a player accessible in that scope, use the function they provided above instead. Example:

PHP Code:

function onCreated() {
  
temp.pl findplayer("yourAccount");
  
temp.pl.chat sendListerRequest("checkinguild", {temp.pl.accounttemp.pl.guild});
}

function 
sendListerRequest(temp.optiontemp.params) {
  
sendtext("lister"temp.optiontemp.params);
  
  if (
waitfor(this"ReceiveText"15)) {
    if (
params[0] == "lister") {
      
temp.returndata params;
      
temp.returndata.delete(0);
      
      return 
temp.returndata;
    }
      
    return 
false;
  }
  
  return 
false;



sssssssssss 12-21-2011 03:49 AM

Ok, so I need to break up the return data to check and print it out, and I've tried all I could think of, but its not go. Is it passible to client at all?

Ive tried doing
PHP Code:

temp.poo sendListerRequest("checkinguild", {temp.pl.accounttemp.pl.guild})[0]; 

and so on but it wont send in triggerClient.

Iv also done

PHP Code:

if (waitfor(this"ReceiveText"15)) {
    if (
params[0] == "lister") {
      
temp.returndata params;
      
temp.returndata.delete(0);
      
temp.guildcheck returndata[0];
      
temp.guildacct returndata[1][0];
      
temp.guildname returndata[1][1];
      
temp.guildnick returndata[1][2];
      
temp.guildrank returndata[1][3];
      echo(
guildcheck,guildacct,guildname,guildnick,guildrank);
      
//return {guildcheck,guildacct,guildname,guildnick,guildrank};
      
triggerClient("gui",name,"gotGuildInfo",guildcheck,guildacct,
      
guildname,guildnick,guildrank);
    } 

which has been the closest, but doing that trigger is useless too. Ive also tried to send the sendListerRequest function in the triggerClient itself as param2, then breaking it up clientside, but that didnt work either. I'm out of ideas. :/
When i echo the last one i posted, its all fine, just need to send it off to client.

sssssssssss 12-21-2011 04:41 AM

Just to add it also will not let me set them as a clientr.var either. Does this information just show up and that's the end of it?

sssssssssss 12-30-2011 05:52 AM

Bump. How exactly am I supposed to use this? Is the only way to do checks in the function itself and thats it, with no way to parse or chop up the returned information?

sssssssssss 01-09-2012 02:27 AM

Bump. Anyone?

sssssssssss 12-24-2012 04:02 AM

I know I'm reviving an old thread, but I never finished this and was just wondering if the previous options are still the only options.

I'm really just trying to make some in-game guild control, but obviously for global guilds. Don't know if anyone knows if you can have access to the literal "ranks" possibly set players ranks, edit public guild info, ect?

cbk1994 12-24-2012 06:31 AM

I don't think Stefan ever added sendtext commands for that stuff. If he did, I never saw him post any documentation on it.

callimuc 12-24-2012 05:28 PM

found this

Quote:

Originally Posted by born2kill (Post 1559863)
PHP Code:

sendText"lister""checkinguild", { str accountnamestr guildname } ); - returns the players nick in the guild and the players guildrank also returns if the guild is pending !
sendText"lister""checkguildexists"str guildname ); - returns true or false if the guildname exist´ also returns true if the guild is pending 



sssssssssss 12-24-2012 06:15 PM

yeah the sendtext for returning stuff will still be helpful, but I'd rather integrate it with the global guilds completely with in-game control than to have to make server specific systems to compliment it.

Maybe stefan will chime in? I haven't really seen anything about it either which usually means not theres not a way, but you never know I guess...


All times are GMT +2. The time now is 12:25 PM.

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