Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-21-2012, 01:23 AM
Fatel Fatel is offline
Worlds Connected Dev
Join Date: Jun 2012
Posts: 18
Fatel is an unknown quantity at this point
report system problem

not sure how to make whats in the text boxes display in rc.
PHP Code:
//#CLIENTSIDE
function onCreated() {
  new 
GuiWindowCtrl("Report_Window1") {
    
profile GuiBlueWindowProfile;
    
clientrelative true;
    
clientextent "333,141";

    
canmove true;
    
canresize true;
    
closequery false;
    
destroyonhide false;
    
firstresponder "Editor_Button1";
    
text "Worlds Connected Report Manager,by Fatel";
    
318;
    
67;

    new 
GuiTextEditCtrl("Report_TextEdit1") {
      
profile GuiBlueTextEditProfile;
      
height 20;
      
width 171;
      
89;
      
71;
    }
    new 
GuiTextEditCtrl("Report_TextEdit2") {
      
profile GuiBlueTextEditProfile;
      
height 20;
      
width 80;
      
125;
      
29;
    }
    new 
GuiButtonCtrl("Report_Button1") {
      
profile GuiBlueButtonProfile;
      
text "Report!";
      
width 80;
      
129;
      
100;
    }
    new 
GuiTextCtrl("Report_Text1") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Player name:";
      
width 73;
      
48;
      
28;
    }
    new 
GuiTextCtrl("Report_Text2") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Reason:";
      
width 48;
      
39;
      
71;
    }
  }
}

function 
Report_Button1.onAction() {
  
// Button "Report!" has been pressed
 

Attached Thumbnails
Click image for larger version

Name:	ugh.png
Views:	216
Size:	15.8 KB
ID:	54967  
__________________
Reply With Quote
  #2  
Old 07-21-2012, 01:38 AM
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
When the button is clicked, trigger serverside with the data from those text fields and use either the echo(message) or sendToRC(message) command to output to RC.

You can read more about serverside, clientside, and triggers here.

You can find a simple example of responding to clicks on GUI buttons here.
__________________
Reply With Quote
  #3  
Old 07-21-2012, 02:22 AM
Fatel Fatel is offline
Worlds Connected Dev
Join Date: Jun 2012
Posts: 18
Fatel is an unknown quantity at this point
Quote:
Originally Posted by cbk1994 View Post
When the button is clicked, trigger serverside with the data from those text fields and use either the echo(message) or sendToRC(message) command to output to RC.

You can read more about serverside, clientside, and triggers here.

You can find a simple example of responding to clicks on GUI buttons here.
i know about triggers corresponding with buttons in a GUI, i want it to send the info in the text boxes to rc, im not sure how to make the text send to rc when i press "Report!"
__________________
Reply With Quote
  #4  
Old 07-21-2012, 02:40 AM
BlueMelon BlueMelon is offline
asdfg
BlueMelon's Avatar
Join Date: Sep 2008
Posts: 1,481
BlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to behold
PHP Code:

function onActionServerSide(cmd,player_name,report_reason){
  if(
cmd == "report"){
    echo(
"REPORT: Player name: "@player_name@" Reason: "@report_reason@" from: "@player.account);
  }
}


//#CLIENTSIDE

// ... GUI Code

function Report_Button1.onAction(){
  
temp.player_name Report_Text1.text;
  
temp.reason Report_Text2.text;
  
triggerserver("gui",this.name,"report",temp.player_name,temp.reason);

Here is a quick example on how to trigger serverside to echo.
I suggest you follow proper naming conventions when naming your GUI controls.
http://forums.graalonline.com/forums...ad.php?t=85600
__________________
http://i.imgur.com/OOJbW.jpg
Reply With Quote
  #5  
Old 07-21-2012, 03:00 AM
Fatel Fatel is offline
Worlds Connected Dev
Join Date: Jun 2012
Posts: 18
Fatel is an unknown quantity at this point
Quote:
Originally Posted by BlueMelon View Post
PHP Code:

function onActionServerSide(cmd,player_name,report_reason){
  if(
cmd == "report"){
    echo(
"REPORT: Player name: "@player_name@" Reason: "@report_reason@" from: "@player.account);
  }
}


//#CLIENTSIDE

// ... GUI Code

function Report_Button1.onAction(){
  
temp.player_name Report_Text1.text;
  
temp.reason Report_Text2.text;
  
triggerserver("gui",this.name,"report",temp.player_name,temp.reason);

Here is a quick example on how to trigger serverside to echo.
I suggest you follow proper naming conventions when naming your GUI controls.
http://forums.graalonline.com/forums...ad.php?t=85600
RC sends this message:
Quote:
REPORT: Player name: Player name: Reason: Reason: from: Graal809560
__________________
Reply With Quote
  #6  
Old 07-21-2012, 03:56 AM
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
Report_Text1 and Report_Text2 are the label controls, not the input boxes. Name your GUI controls properly and it'll be less confusing.

Report_TextEdit1 and Report_TextEdit2 are the ones you want.
__________________
Reply With Quote
  #7  
Old 07-21-2012, 04:00 AM
BlueMelon BlueMelon is offline
asdfg
BlueMelon's Avatar
Join Date: Sep 2008
Posts: 1,481
BlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to behold
Quote:
Originally Posted by cbk1994 View Post
Report_Text1 and Report_Text2 are the label controls, not the input boxes. Name your GUI controls properly and it'll be less confusing.

Report_TextEdit1 and Report_TextEdit2 are the ones you want.



It does indeed get confusing.
As you can see.
__________________
http://i.imgur.com/OOJbW.jpg
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 05:34 AM.


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