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 05-30-2010, 09:21 PM
xMane xMane is offline
NPC-Server (Server)
xMane's Avatar
Join Date: May 2010
Posts: 59
xMane is on a distinguished road
GUI.findtext(str)?

how would this commands work?
this.hirefind = player.account;
if(Biz_HireEdit.findtext(this.hirefind))
player.chat="yipeeee!";
Reply With Quote
  #2  
Old 05-30-2010, 09:25 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
What exactly are you trying to accomplish?
__________________
Reply With Quote
  #3  
Old 05-30-2010, 09:26 PM
xMane xMane is offline
NPC-Server (Server)
xMane's Avatar
Join Date: May 2010
Posts: 59
xMane is on a distinguished road
also how i do this clientside or serverside or make it work.
function onTimeout()
{
this.i = findplayer ( Biz_BizPlayerList.getselectedtext() );
Biz_PlayerRank.settext(this.i.clientr.bizinfo[1]);
Biz_PlayerAdmin.settext(this.i.clientr.bizinfo[2]);
Biz_PlayerName.settext(@Biz_BizPlayerList.getselec tedtext());
setTimer(0.05);
}
it only works for my player.
Reply With Quote
  #4  
Old 05-30-2010, 09:27 PM
xMane xMane is offline
NPC-Server (Server)
xMane's Avatar
Join Date: May 2010
Posts: 59
xMane is on a distinguished road
Quote:
Originally Posted by cbk1994 View Post
What exactly are you trying to accomplish?
if a player is not yet on a list it can be added
like if(!GUI.findtext(Graal757488))GUI.addrow(1,Graal75 7488);
get me?
Reply With Quote
  #5  
Old 05-30-2010, 09:39 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
Please wrap code in PHP tags to maintain readability.

PHP Code:
GuiContextMenuCtrl.findtext(str) - returns integer row index
GuiPopUpEditCtrl
.findtext(str) - returns integer
GuiPopUpEditCtrl
.findtext(str) - returns integer row index
GuiPopUpMenuCtrl
.findtext(str) - returns integer
GuiPopUpMenuCtrl
.findtext(str) - returns integer row index
GuiTabCtrl
.findtext(str) - returns integer row index
GuiTextListCtrl
.findtext(str) - returns integer row index
GuiContextMenuCtrl
.findtextid(str) - returns integer row id
GuiPopUpEditCtrl
.findtextid(str) - returns integer row id
GuiPopUpMenuCtrl
.findtextid(str) - returns integer row id
GuiTabCtrl
.findtextid(str) - returns integer row id
GuiTextListCtrl
.findtextid(str) - returns integer row id 
If it doesn't it find it, it should be returning a -1.

PHP Code:
if (object.findtext("Hello World") >= 0) {
  
// Hello World was found in the list.
} else {
  
// Hello World was not found in the list.

__________________
Quote:
Reply With Quote
  #6  
Old 05-30-2010, 11:28 PM
xMane xMane is offline
NPC-Server (Server)
xMane's Avatar
Join Date: May 2010
Posts: 59
xMane is on a distinguished road
?

one last thing. i want a list to keep the accounts on it everytime i open it.
like server side how would i do this?
like
serveroptions:
PHP Code:
serverr.biz1names=graal757488,n00bcakes 
script:
PHP Code:
 GUI.addrow(serverr.biz1names); 
????
Reply With Quote
  #7  
Old 05-30-2010, 11:41 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 access the your staff list on the server-side with code like this:

temp.staff = serveroptions.staff.tokenize(",");

Personally I'd use triggerserver, retrieve the staff list, and send the list to the client with triggerclient instead of serverr variable.
__________________
Quote:
Reply With Quote
  #8  
Old 05-30-2010, 11:53 PM
xMane xMane is offline
NPC-Server (Server)
xMane's Avatar
Join Date: May 2010
Posts: 59
xMane is on a distinguished road
ok now how would i make it add all the accounts in the serveroptions
like
temp.staff[temp.staff.size] or wat goes in [] to get all the staff on the list ? not just 1
because its a mutli-line gui
Reply With Quote
  #9  
Old 05-30-2010, 11:56 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
In my example, temp.staff would be the equivalent to:

temp.staff = {"account", "account"};

You'll have to use a for loop to go through the array and add the accounts one at a time into your GUI.

For Loop Example: http://forums.graalonline.com/forums...hp?t=134259285
__________________
Quote:
Reply With Quote
  #10  
Old 05-31-2010, 12:07 AM
xMane xMane is offline
NPC-Server (Server)
xMane's Avatar
Join Date: May 2010
Posts: 59
xMane is on a distinguished road
so the correct way to do this how? i keep trying but idk what to do here.
PHP Code:
  this.hirebiz clientr.bizname;
  
this.bizstaff serverr.(@this.hirebiz@"accounts").tokenize(",");
  for (
temp.0this.bizstaff.size(); ++)
  
this.bizstaffsize this.bizstaff[x];
Biz_BizPlayerList.addrow(this.amountrow,this.bizstaff[this.bizstaffsize]); 
or how would this be? because that code is not working x.x
Reply With Quote
  #11  
Old 05-31-2010, 01:54 AM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Quote:
Originally Posted by xMane View Post
so the correct way to do this how? i keep trying but idk what to do here.
PHP Code:
  this.hirebiz clientr.bizname;
  
this.bizstaff serverr.(@this.hirebiz@"accounts").tokenize(",");
  for (
temp.0this.bizstaff.size(); ++)
  
this.bizstaffsize this.bizstaff[x];
Biz_BizPlayerList.addrow(this.amountrow,this.bizstaff[this.bizstaffsize]); 
or how would this be? because that code is not working x.x

Ahh, close
HTML Code:
  for (temp.x; temp.x < this.bizstaff.size(); temp.x++) {
    Biz_BizPlayerList.addRow(temp.x, this.bizstaff[temp.x]);
  }
__________________
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:38 PM.


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