Graalians

Graalians (https://www.graalians.com/forums/index.php)
-   Creative Corner (https://www.graalians.com/forums/forumdisplay.php?f=17)
-   -   John's Scripts (https://www.graalians.com/forums/showthread.php?t=9528)

Johnaudi 08-18-2012 05:25 PM

John's Scripts
 
Hey,
Got bored a bit, and don't know what to add to the scripts I made a while back. so having you guys give me an opinion would help. Also, I'm still at a learning stage to any developer feel free to correct me/teach me anything new or give me idea's or other ways to do the certain thing.
Echo from NC (Made while learning triggerserver)
  • Current usage by saying "/echo TextGoesHere"
  • Can echo from the player's chat to RC
  • Anti-Spam built (yes, I know timevar2 but I have thought of a different way)
Spoiler

PHP Code:

function onActionServerSide() {
  if (
params[0] == "cmd") {
    
this.toks player.chat.substring(6);
    echo(
player.nick " [" player.account "] : " this.toks);
  }
}

//#CLIENTSIDE
function onCreated() {
  
this.num 1;
}

function 
onPlayerChats() {
  if (
player.chat.starts("/echo")) {
    if (
this.num == 1) {
      
this.toks player.chat.substring(6);
      
triggerserver("gui"name"cmd");
      
sleep(0.1);
      
this.num 0;
      
setTimer(0.01);
      
player.chat "Echo'ed : " player.chat.substring(6);
    } else 
player.chat "Please wait 5 seconds before sending another Echo!";
  }
}

function 
onTimeOut() {
  if (
this.num == 0) {
    
sleep(5);
    
this.num 1;
  }
  
setTimer(0.1);



Level Warper (GUI)
  • Current usage by saying "openwarper"
  • Simple GUI with the default interface
  • Option to warp to players / or level's using correct coordinates
  • Can stick the player("/stick Graal######") which can keep him on track and stop tracing too ("/unstick")
  • Some minor Errors on warping to 0,0 (x,y)
Spoiler

PHP Code:

//#CLIENTSIDE
function onPlayerChats() {
  if (
player.chat == "openwarper") {
    
drawGUI();
    
LevWarps_Window2.visible true;
  }
}

function 
drawGUI() {
  new 
GuiWindowCtrl("LevWarps_Window2") {
    
profile GuiBlueWindowProfile;
    
clientrelative true;
    
clientextent "320,189";
    
canmaximize false;
    
canminimize false;
    
canmove true;
    
canresize true;
    
closequery false;
    
destroyonhide false;
    
text "Level Warper";
    
486;
    
272;
    new 
GuiButtonCtrl("LevWarps_Button2") {
      
profile GuiBlueButtonProfile;
      
height 35;
      
text "Warp";
      
width 131;
      
97;
      
135;
    }
    new 
GuiTextCtrl("LevWarps_Text1") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "X";
      
width 8;
      
38;
      
29;
    }
    new 
GuiTextCtrl("LevWarps_Text2") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Y";
      
width 9;
      
107;
      
29;
    }
    new 
GuiTextCtrl("LevWarps_Text3") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Level Name";
      
width 67;
      
171;
      
29;
    }
    new 
GuiTextEditCtrl("LevWarps_TextEdit1") {
      
profile GuiBlueTextEditProfile;
      
height 20;
      
width 34;
      
34;
      
50;
    }
    new 
GuiTextEditCtrl("LevWarps_TextEdit2") {
      
profile GuiBlueTextEditProfile;
      
height 20;
      
width 34;
      
105;
      
50;
    }
    new 
GuiTextEditCtrl("LevWarps_TextEdit3") {
      
profile GuiBlueTextEditProfile;
      
height 20;
      
width 106;
      
167;
      
50;
    }
    new 
GuiCheckBoxCtrl("LevWarps_CheckBox1") {
      
profile GuiBlueCheckBoxProfile;
      
height 20;
      
text "Player Warp  :";
      
width 100;
      
69;
      
85;
    }
    new 
GuiTextEditCtrl("LevWarps_TextEdit4") {
      
profile GuiBlueTextEditProfile;
      
height 20;
      
width 106;
      
167;
      
85;
    }
  }
}

function 
LevWarps_Button2.onAction() {
  if (
LevWarps_CheckBox1.checked && LevWarps_TextEdit4.text != "") {
    
toks LevWarps_TextEdit4.text.tokenize(" ");
    if (
LevWarps_TextEdit4.text.starts("/stick")) {
      
pl findplayerbycommunityname(toks[1]);
      
this.number 1;
      
settimer(0.01);
      return;
    }
    if (
LevWarps_TextEdit4.text == "/unstick") {
      
this.number 0;
      return;
    }
    
temp.pl findplayerbycommunityname(LevWarps_TextEdit4.text);
    
player.temp.pl.x;
    
player.temp.pl.y;
    
player.level temp.pl.level;
    
LevWarps_TextEdit1.text temp.pl.x;
    
LevWarps_TextEdit2.text temp.pl.y;
    
LevWarps_TextEdit3.text temp.pl.level;
    
player.chat "x: " player." y: " player." level: " player.level;
  } else {
    if (
LevWarps_TextEdit1 != "") {
      
player.LevWarps_TextEdit1.text;
    }
    if (
LevWarps_TextEdit2 != "") {
      
player.LevWarps_TextEdit2.text;
    }
    if (
LevWarps_TextEdit3 != "") {
      
player.level LevWarps_TextEdit3.text;
    }
  }
}

function 
onTimeout() {
  if (
this.number == 1) {
    
player.= (pl.2);
    
player.= (pl.1);
    
setTimer(0.2);
  } else return;



Calculator (GUI)
  • Current usage by saying "/calc"
  • Quick calculation tool with both "buttons" and "text" (Sadly' I don't know how to limit the text by numbers only)
  • Works with addition, subtraction , multiplication and division
  • Auto closing parentheses (kinda useless atm)
Spoiler

PHP Code:

//#CLIENTSIDE
function onCreated() {
  
n1.value 1;
  
n2.value 2;
  
n3.value 3;
  
n4.value 4;
  
n5.value 5;
  
n6.value 6;
  
n7.value 7;
  
n8.value 8;
  
n9.value 9;
  
n0.value 0;
  
nP.value ".";
  
nPar.value1 "(";
  
nPar.value2 ")";
  
this.mode NULL;
  
this.started true;
  
Calculator_Tb1.text "";
  
Calculator_Tb2.text "";
  
Calculator_Result.text "";
  
Calculator_mode.text "";
  
nPar.stated false;
}

function 
onPlayerChats() {
  if (
player.chat == "/calc") {
    
drawGUI();
    
Calculator_Window1.visible true;
    
onCreated();
  }
}

function 
drawGUI() {
  new 
GuiWindowCtrl("Calculator_Window1") {
    
profile GuiBlueWindowProfile;
    
clientrelative true;
    
clientextent "271,268";
    
canmaximize false;
    
canminimize false;
    
canmove true;
    
canresize false;
    
closequery false;
    
destroyonhide false;
    
text "Calculator";
    
541;
    
255;
    new 
GuiButtonCtrl("Calculator_nP") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text ".";
      
width 39;
      
130;
      
220;
    }
    new 
GuiButtonCtrl("Calculator_nPar") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text "( )";
      
width 39;
      
30;
      
220;
    }
    new 
GuiButtonCtrl("Calculator_n0") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text "0";
      
width 39;
      
80;
      
220;
    }
    new 
GuiButtonCtrl("Calculator_n1") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text "1";
      
width 39;
      
30;
      
177;
    }
    new 
GuiButtonCtrl("Calculator_n2") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text "2";
      
width 39;
      
80;
      
177;
    }
    new 
GuiButtonCtrl("Calculator_n3") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text "3";
      
width 39;
      
130;
      
177;
    }
    new 
GuiButtonCtrl("Calculator_n4") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text "4";
      
width 39;
      
30;
      
130;
    }
    new 
GuiButtonCtrl("Calculator_n5") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text "5";
      
width 39;
      
80;
      
130;
    }
    new 
GuiButtonCtrl("Calculator_n6") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text "6";
      
width 39;
      
130;
      
130;
    }
    new 
GuiButtonCtrl("Calculator_n7") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text "7";
      
width 39;
      
30;
      
83;
    }
    new 
GuiButtonCtrl("Calculator_n8") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text "8";
      
width 39;
      
80;
      
83;
    }
    new 
GuiButtonCtrl("Calculator_n9") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text "9";
      
width 39;
      
130;
      
83;
    }
    new 
GuiButtonCtrl("Calculator_add") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text "+";
      
width 25;
      
180;
      
130;
    }
    new 
GuiButtonCtrl("Calculator_min") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text "-";
      
width 25;
      
215;
      
130;
    }
    new 
GuiButtonCtrl("Calculator_tim") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text "X";
      
width 25;
      
180;
      
177;
    }
    new 
GuiButtonCtrl("Calculator_div") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text "/";
      
width 25;
      
215;
      
177;
    }
    new 
GuiButtonCtrl("Calculator_equ") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text "=";
      
width 60;
      
180;
      
220;
    }
    new 
GuiButtonCtrl("Calculator_C") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text "Clear";
      
width 60;
      
180;
      
83;
    }
    new 
GuiTextEditCtrl("Calculator_Tb1") {
      
profile GuiBlueTextEditProfile;
      
height 20;
      
width 36;
      
31;
      
34;
    }
    new 
GuiTextCtrl("Calculator_mode") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "";
      
width 8;
      
88;
      
32;
    }
    new 
GuiTextEditCtrl("Calculator_Tb2") {
      
profile GuiBlueTextEditProfile;
      
height 20;
      
width 36;
      
114;
      
34;
    }
    new 
GuiTextCtrl("Calculator_Text2") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "=";
      
width 8;
      
162;
      
33;
    }
    new 
GuiTextCtrl("Calculator_Result") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "";
      
width 36;
      
186;
      
30;
    }
  }
}

function 
Calculator_nPar.onAction() {
  if (
this.started == true) {
    if (
Calculator_Tb1.text == "" && nPar.stated == false) {
      
Calculator_Tb1.text nPar.value1;
      
nPar.stated true;
    } else if (
nPar.stated == false) {
      
Calculator_Tb1.text Calculator_Tb1.text nPar.value1;
      
nPar.stated true;
    } else if (
nPar.stated == true) {
      
Calculator_Tb1.text Calculator_Tb1.text nPar.value2;
      
nPar.stated false;
    }
  }
  if (
this.started == false) {
    if (
Calculator_Tb2.text == "" && nPar.stated == false) {
      
Calculator_Tb2.text nPar.value1;
      
nPar.stated true;
    } else if (
nPar.stated == false) {
      
Calculator_Tb2.text Calculator_Tb2.text nPar.value1;
      
nPar.stated true;
    } else if (
nPar.stated == true) {
      
Calculator_Tb2.text Calculator_Tb2.text nPar.value2;
      
nPar.stated false;
    }
  }
}

function 
Calculator_nP.onAction() {
  if (
this.started == true) {
    if (
Calculator_Tb1.text == "") {
      
Calculator_Tb1.text nP.value;
    } else 
Calculator_Tb1.text Calculator_Tb1.text nP.value;
  }
  if (
this.started == false) {
    if (
Calculator_Tb2.text == "") {
      
Calculator_Tb2.text nP.value;
    } else 
Calculator_Tb2.text Calculator_Tb2.text nP.value;
  }
}

function 
Calculator_n0.onAction() {
  if (
this.started == true) {
    if (
Calculator_Tb1.text == "") {
      
Calculator_Tb1.text n0.value;
    } else 
Calculator_Tb1.text Calculator_Tb1.text n0.value;
  }
  if (
this.started == false) {
    if (
Calculator_Tb2.text == "") {
      
Calculator_Tb2.text n0.value;
    } else 
Calculator_Tb2.text Calculator_Tb2.text n0.value;
  }
}

function 
Calculator_n1.onAction() {
  if (
this.started == true) {
    if (
Calculator_Tb1.text == "") {
      
Calculator_Tb1.text n1.value;
    } else 
Calculator_Tb1.text Calculator_Tb1.text n1.value;
  }
  if (
this.started == false) {
    if (
Calculator_Tb2.text == "") {
      
Calculator_Tb2.text n1.value;
    } else 
Calculator_Tb2.text Calculator_Tb2.text n1.value;
  }
}

function 
Calculator_n2.onAction() {
  if (
this.started == true) {
    if (
Calculator_Tb1.text == "") {
      
Calculator_Tb1.text n2.value;
    } else 
Calculator_Tb1.text Calculator_Tb1.text n2.value;
  }
  if (
this.started == false) {
    if (
Calculator_Tb2.text == "") {
      
Calculator_Tb2.text n2.value;
    } else 
Calculator_Tb2.text Calculator_Tb2.text n2.value;
  }
}

function 
Calculator_n3.onAction() {
  if (
this.started == true) {
    if (
Calculator_Tb1.text == "") {
      
Calculator_Tb1.text n3.value;
    } else 
Calculator_Tb1.text Calculator_Tb1.text n3.value;
  }
  if (
this.started == false) {
    if (
Calculator_Tb2.text == "") {
      
Calculator_Tb2.text n3.value;
    } else 
Calculator_Tb2.text Calculator_Tb2.text n3.value;
  }
}

function 
Calculator_n4.onAction() {
  if (
this.started == true) {
    if (
Calculator_Tb1.text == "") {
      
Calculator_Tb1.text n4.value;
    } else 
Calculator_Tb1.text Calculator_Tb1.text n4.value;
  }
  if (
this.started == false) {
    if (
Calculator_Tb2.text == "") {
      
Calculator_Tb2.text n4.value;
    } else 
Calculator_Tb2.text Calculator_Tb2.text n4.value;
  }
}

function 
Calculator_n5.onAction() {
  if (
this.started == true) {
    if (
Calculator_Tb1.text == "") {
      
Calculator_Tb1.text n5.value;
    } else 
Calculator_Tb1.text Calculator_Tb1.text n5.value;
  }
  if (
this.started == false) {
    if (
Calculator_Tb2.text == "") {
      
Calculator_Tb2.text n5.value;
    } else 
Calculator_Tb2.text Calculator_Tb2.text n5.value;
  }
}

function 
Calculator_n6.onAction() {
  if (
this.started == true) {
    if (
Calculator_Tb1.text == "") {
      
Calculator_Tb1.text n6.value;
    } else 
Calculator_Tb1.text Calculator_Tb1.text n6.value;
  }
  if (
this.started == false) {
    if (
Calculator_Tb2.text == "") {
      
Calculator_Tb2.text n6.value;
    } else 
Calculator_Tb2.text Calculator_Tb2.text n6.value;
  }
}

function 
Calculator_n7.onAction() {
  if (
this.started == true) {
    if (
Calculator_Tb1.text == "") {
      
Calculator_Tb1.text n7.value;
    } else 
Calculator_Tb1.text Calculator_Tb1.text n7.value;
  }
  if (
this.started == false) {
    if (
Calculator_Tb2.text == "") {
      
Calculator_Tb2.text n7.value;
    } else 
Calculator_Tb2.text Calculator_Tb2.text n7.value;
  }
}

function 
Calculator_n8.onAction() {
  if (
this.started == true) {
    if (
Calculator_Tb1.text == "") {
      
Calculator_Tb1.text n8.value;
    } else 
Calculator_Tb1.text Calculator_Tb1.text n8.value;
  }
  if (
this.started == false) {
    if (
Calculator_Tb2.text == "") {
      
Calculator_Tb2.text n8.value;
    } else 
Calculator_Tb2.text Calculator_Tb2.text n8.value;
  }
}

function 
Calculator_n9.onAction() {
  if (
this.started == true) {
    if (
Calculator_Tb1.text == "") {
      
Calculator_Tb1.text n9.value;
    } else 
Calculator_Tb1.text Calculator_Tb1.text n9.value;
  }
  if (
this.started == false) {
    if (
Calculator_Tb2.text == "") {
      
Calculator_Tb2.text n9.value;
    } else 
Calculator_Tb2.text Calculator_Tb2.text n9.value;
  }
}

function 
Calculator_add.onAction() {
  if (
this.started == true) {
    
this.started false;
    
this.mode "+";
    
nPar.stated false;
    
Calculator_mode.text this.mode;
  }
}

function 
Calculator_min.onAction() {
  if (
this.started == true) {
    
this.started false;
    
this.mode "-";
    
nPar.stated false;
    
Calculator_mode.text this.mode;
  }
}

function 
Calculator_tim.onAction() {
  if (
this.started == true) {
    
this.started false;
    
this.mode "X";
    
nPar.stated false;
    
Calculator_mode.text this.mode;
  }
}

function 
Calculator_div.onAction() {
  if (
this.started == true) {
    
this.started false;
    
this.mode "/";
    
nPar.stated false;
    
Calculator_mode.text this.mode;
  }
}

function 
Calculator_C.onAction() {
  
this.mode NULL;
  
nPar.stated false;
  
this.started true;
  
Calculator_Tb1.text "";
  
Calculator_Tb2.text "";
  
Calculator_Result.text "";
  
Calculator_mode.text "";
}

function 
Calculator_equ.onAction() {
  if (
Calculator_Tb1.text == "" || Calculator_Tb2.text == "") {
    return;
  }
  if (
this.mode == "+") {
    
Calculator_Result.text Calculator_Tb1.text Calculator_Tb2.text;
  }
  if (
this.mode == "-") {
    
Calculator_Result.text Calculator_Tb1.text Calculator_Tb2.text;
  }
  if (
this.mode == "X") {
    
Calculator_Result.text Calculator_Tb1.text Calculator_Tb2.text;
  }
  if (
this.mode == "/") {
    
Calculator_Result.text Calculator_Tb1.text Calculator_Tb2.text;
  }



-------------------------------------------------
Any errors? Please tell me so I can learn. I'd Like to Thank Emera and Callimuc for all the effort they put into teaching me those. Can't thank you enough guys :)

Bulldogg Lucero 08-18-2012 05:54 PM

Man thats bad to many Errors you should throw it away man you'll never make it

Nah jk, i'm reall not that good with scipts

But does it work on Offline Editor? xD

Johnaudi 08-18-2012 06:00 PM

Quote:

Posted by Bulldogg Lucero (Post 182315)
But does it work on Offline Editor? xD

It's Gs2, Offline Editor uses Gs1.

Bulldogg Lucero 08-18-2012 06:03 PM

Oh, well they should upgrade that :\

Emera 08-18-2012 07:44 PM

Quote:

Posted by Johnaudi (Post 182303)
Hey,
Got bored a bit, and don't know what to add to the scripts I made a while back. so having you guys give me an opinion would help. Also, I'm still at a learning stage to any developer feel free to correct me/teach me anything new or give me idea's or other ways to do the certain thing.
Echo from NC (Made while learning triggerserver)
  • Current usage by saying "/echo TextGoesHere"
  • Can echo from the player's chat to RC
  • Anti-Spam built (yes, I know timevar2 but I have thought of a different way)
Spoiler

PHP Code:

function onActionServerSide() {
  if (
params[0] == "cmd") {
    
this.toks player.chat.substring(6);
    echo(
player.nick " [" player.account "] : " this.toks);
  }
}

//#CLIENTSIDE
function onCreated() {
  
this.num 1;
}

function 
onPlayerChats() {
  if (
player.chat.starts("/echo")) {
    if (
this.num == 1) {
      
this.toks player.chat.substring(6);
      
triggerserver("gui"name"cmd");
      
sleep(0.1);
      
this.num 0;
      
setTimer(0.01);
      
player.chat "Echo'ed : " player.chat.substring(6);
    } else 
player.chat "Please wait 5 seconds before sending another Echo!";
  }
}

function 
onTimeOut() {
  if (
this.num == 0) {
    
sleep(5);
    
this.num 1;
  }
  
setTimer(0.1);



Level Warper (GUI)
  • Current usage by saying "openwarper"
  • Simple GUI with the default interface
  • Option to warp to players / or level's using correct coordinates
  • Can stick the player("/stick Graal######") which can keep him on track and stop tracing too ("/unstick")
  • Some minor Errors on warping to 0,0 (x,y)
Spoiler

PHP Code:

//#CLIENTSIDE
function onPlayerChats() {
  if (
player.chat == "openwarper") {
    
drawGUI();
    
LevWarps_Window2.visible true;
  }
}

function 
drawGUI() {
  new 
GuiWindowCtrl("LevWarps_Window2") {
    
profile GuiBlueWindowProfile;
    
clientrelative true;
    
clientextent "320,189";
    
canmaximize false;
    
canminimize false;
    
canmove true;
    
canresize true;
    
closequery false;
    
destroyonhide false;
    
text "Level Warper";
    
486;
    
272;
    new 
GuiButtonCtrl("LevWarps_Button2") {
      
profile GuiBlueButtonProfile;
      
height 35;
      
text "Warp";
      
width 131;
      
97;
      
135;
    }
    new 
GuiTextCtrl("LevWarps_Text1") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "X";
      
width 8;
      
38;
      
29;
    }
    new 
GuiTextCtrl("LevWarps_Text2") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Y";
      
width 9;
      
107;
      
29;
    }
    new 
GuiTextCtrl("LevWarps_Text3") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Level Name";
      
width 67;
      
171;
      
29;
    }
    new 
GuiTextEditCtrl("LevWarps_TextEdit1") {
      
profile GuiBlueTextEditProfile;
      
height 20;
      
width 34;
      
34;
      
50;
    }
    new 
GuiTextEditCtrl("LevWarps_TextEdit2") {
      
profile GuiBlueTextEditProfile;
      
height 20;
      
width 34;
      
105;
      
50;
    }
    new 
GuiTextEditCtrl("LevWarps_TextEdit3") {
      
profile GuiBlueTextEditProfile;
      
height 20;
      
width 106;
      
167;
      
50;
    }
    new 
GuiCheckBoxCtrl("LevWarps_CheckBox1") {
      
profile GuiBlueCheckBoxProfile;
      
height 20;
      
text "Player Warp  :";
      
width 100;
      
69;
      
85;
    }
    new 
GuiTextEditCtrl("LevWarps_TextEdit4") {
      
profile GuiBlueTextEditProfile;
      
height 20;
      
width 106;
      
167;
      
85;
    }
  }
}

function 
LevWarps_Button2.onAction() {
  if (
LevWarps_CheckBox1.checked && LevWarps_TextEdit4.text != "") {
    
toks LevWarps_TextEdit4.text.tokenize(" ");
    if (
LevWarps_TextEdit4.text.starts("/stick")) {
      
pl findplayerbycommunityname(toks[1]);
      
this.number 1;
      
settimer(0.01);
      return;
    }
    if (
LevWarps_TextEdit4.text == "/unstick") {
      
this.number 0;
      return;
    }
    
temp.pl findplayerbycommunityname(LevWarps_TextEdit4.text);
    
player.temp.pl.x;
    
player.temp.pl.y;
    
player.level temp.pl.level;
    
LevWarps_TextEdit1.text temp.pl.x;
    
LevWarps_TextEdit2.text temp.pl.y;
    
LevWarps_TextEdit3.text temp.pl.level;
    
player.chat "x: " player." y: " player." level: " player.level;
  } else {
    if (
LevWarps_TextEdit1 != "") {
      
player.LevWarps_TextEdit1.text;
    }
    if (
LevWarps_TextEdit2 != "") {
      
player.LevWarps_TextEdit2.text;
    }
    if (
LevWarps_TextEdit3 != "") {
      
player.level LevWarps_TextEdit3.text;
    }
  }
}

function 
onTimeout() {
  if (
this.number == 1) {
    
player.= (pl.2);
    
player.= (pl.1);
    
setTimer(0.2);
  } else return;



Calculator (GUI)
  • Current usage by saying "/calc"
  • Quick calculation tool with both "buttons" and "text" (Sadly' I don't know how to limit the text by numbers only)
  • Works with addition, subtraction , multiplication and division
  • Auto closing parentheses (kinda useless atm)
Spoiler

PHP Code:

//#CLIENTSIDE
function onCreated() {
  
n1.value 1;
  
n2.value 2;
  
n3.value 3;
  
n4.value 4;
  
n5.value 5;
  
n6.value 6;
  
n7.value 7;
  
n8.value 8;
  
n9.value 9;
  
n0.value 0;
  
nP.value ".";
  
nPar.value1 "(";
  
nPar.value2 ")";
  
this.mode NULL;
  
this.started true;
  
Calculator_Tb1.text "";
  
Calculator_Tb2.text "";
  
Calculator_Result.text "";
  
Calculator_mode.text "";
  
nPar.stated false;
}

function 
onPlayerChats() {
  if (
player.chat == "/calc") {
    
drawGUI();
    
Calculator_Window1.visible true;
    
onCreated();
  }
}

function 
drawGUI() {
  new 
GuiWindowCtrl("Calculator_Window1") {
    
profile GuiBlueWindowProfile;
    
clientrelative true;
    
clientextent "271,268";
    
canmaximize false;
    
canminimize false;
    
canmove true;
    
canresize false;
    
closequery false;
    
destroyonhide false;
    
text "Calculator";
    
541;
    
255;
    new 
GuiButtonCtrl("Calculator_nP") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text ".";
      
width 39;
      
130;
      
220;
    }
    new 
GuiButtonCtrl("Calculator_nPar") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text "( )";
      
width 39;
      
30;
      
220;
    }
    new 
GuiButtonCtrl("Calculator_n0") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text "0";
      
width 39;
      
80;
      
220;
    }
    new 
GuiButtonCtrl("Calculator_n1") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text "1";
      
width 39;
      
30;
      
177;
    }
    new 
GuiButtonCtrl("Calculator_n2") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text "2";
      
width 39;
      
80;
      
177;
    }
    new 
GuiButtonCtrl("Calculator_n3") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text "3";
      
width 39;
      
130;
      
177;
    }
    new 
GuiButtonCtrl("Calculator_n4") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text "4";
      
width 39;
      
30;
      
130;
    }
    new 
GuiButtonCtrl("Calculator_n5") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text "5";
      
width 39;
      
80;
      
130;
    }
    new 
GuiButtonCtrl("Calculator_n6") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text "6";
      
width 39;
      
130;
      
130;
    }
    new 
GuiButtonCtrl("Calculator_n7") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text "7";
      
width 39;
      
30;
      
83;
    }
    new 
GuiButtonCtrl("Calculator_n8") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text "8";
      
width 39;
      
80;
      
83;
    }
    new 
GuiButtonCtrl("Calculator_n9") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text "9";
      
width 39;
      
130;
      
83;
    }
    new 
GuiButtonCtrl("Calculator_add") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text "+";
      
width 25;
      
180;
      
130;
    }
    new 
GuiButtonCtrl("Calculator_min") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text "-";
      
width 25;
      
215;
      
130;
    }
    new 
GuiButtonCtrl("Calculator_tim") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text "X";
      
width 25;
      
180;
      
177;
    }
    new 
GuiButtonCtrl("Calculator_div") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text "/";
      
width 25;
      
215;
      
177;
    }
    new 
GuiButtonCtrl("Calculator_equ") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text "=";
      
width 60;
      
180;
      
220;
    }
    new 
GuiButtonCtrl("Calculator_C") {
      
profile GuiBlueButtonProfile;
      
height 37;
      
text "Clear";
      
width 60;
      
180;
      
83;
    }
    new 
GuiTextEditCtrl("Calculator_Tb1") {
      
profile GuiBlueTextEditProfile;
      
height 20;
      
width 36;
      
31;
      
34;
    }
    new 
GuiTextCtrl("Calculator_mode") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "";
      
width 8;
      
88;
      
32;
    }
    new 
GuiTextEditCtrl("Calculator_Tb2") {
      
profile GuiBlueTextEditProfile;
      
height 20;
      
width 36;
      
114;
      
34;
    }
    new 
GuiTextCtrl("Calculator_Text2") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "=";
      
width 8;
      
162;
      
33;
    }
    new 
GuiTextCtrl("Calculator_Result") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "";
      
width 36;
      
186;
      
30;
    }
  }
}

function 
Calculator_nPar.onAction() {
  if (
this.started == true) {
    if (
Calculator_Tb1.text == "" && nPar.stated == false) {
      
Calculator_Tb1.text nPar.value1;
      
nPar.stated true;
    } else if (
nPar.stated == false) {
      
Calculator_Tb1.text Calculator_Tb1.text nPar.value1;
      
nPar.stated true;
    } else if (
nPar.stated == true) {
      
Calculator_Tb1.text Calculator_Tb1.text nPar.value2;
      
nPar.stated false;
    }
  }
  if (
this.started == false) {
    if (
Calculator_Tb2.text == "" && nPar.stated == false) {
      
Calculator_Tb2.text nPar.value1;
      
nPar.stated true;
    } else if (
nPar.stated == false) {
      
Calculator_Tb2.text Calculator_Tb2.text nPar.value1;
      
nPar.stated true;
    } else if (
nPar.stated == true) {
      
Calculator_Tb2.text Calculator_Tb2.text nPar.value2;
      
nPar.stated false;
    }
  }
}

function 
Calculator_nP.onAction() {
  if (
this.started == true) {
    if (
Calculator_Tb1.text == "") {
      
Calculator_Tb1.text nP.value;
    } else 
Calculator_Tb1.text Calculator_Tb1.text nP.value;
  }
  if (
this.started == false) {
    if (
Calculator_Tb2.text == "") {
      
Calculator_Tb2.text nP.value;
    } else 
Calculator_Tb2.text Calculator_Tb2.text nP.value;
  }
}

function 
Calculator_n0.onAction() {
  if (
this.started == true) {
    if (
Calculator_Tb1.text == "") {
      
Calculator_Tb1.text n0.value;
    } else 
Calculator_Tb1.text Calculator_Tb1.text n0.value;
  }
  if (
this.started == false) {
    if (
Calculator_Tb2.text == "") {
      
Calculator_Tb2.text n0.value;
    } else 
Calculator_Tb2.text Calculator_Tb2.text n0.value;
  }
}

function 
Calculator_n1.onAction() {
  if (
this.started == true) {
    if (
Calculator_Tb1.text == "") {
      
Calculator_Tb1.text n1.value;
    } else 
Calculator_Tb1.text Calculator_Tb1.text n1.value;
  }
  if (
this.started == false) {
    if (
Calculator_Tb2.text == "") {
      
Calculator_Tb2.text n1.value;
    } else 
Calculator_Tb2.text Calculator_Tb2.text n1.value;
  }
}

function 
Calculator_n2.onAction() {
  if (
this.started == true) {
    if (
Calculator_Tb1.text == "") {
      
Calculator_Tb1.text n2.value;
    } else 
Calculator_Tb1.text Calculator_Tb1.text n2.value;
  }
  if (
this.started == false) {
    if (
Calculator_Tb2.text == "") {
      
Calculator_Tb2.text n2.value;
    } else 
Calculator_Tb2.text Calculator_Tb2.text n2.value;
  }
}

function 
Calculator_n3.onAction() {
  if (
this.started == true) {
    if (
Calculator_Tb1.text == "") {
      
Calculator_Tb1.text n3.value;
    } else 
Calculator_Tb1.text Calculator_Tb1.text n3.value;
  }
  if (
this.started == false) {
    if (
Calculator_Tb2.text == "") {
      
Calculator_Tb2.text n3.value;
    } else 
Calculator_Tb2.text Calculator_Tb2.text n3.value;
  }
}

function 
Calculator_n4.onAction() {
  if (
this.started == true) {
    if (
Calculator_Tb1.text == "") {
      
Calculator_Tb1.text n4.value;
    } else 
Calculator_Tb1.text Calculator_Tb1.text n4.value;
  }
  if (
this.started == false) {
    if (
Calculator_Tb2.text == "") {
      
Calculator_Tb2.text n4.value;
    } else 
Calculator_Tb2.text Calculator_Tb2.text n4.value;
  }
}

function 
Calculator_n5.onAction() {
  if (
this.started == true) {
    if (
Calculator_Tb1.text == "") {
      
Calculator_Tb1.text n5.value;
    } else 
Calculator_Tb1.text Calculator_Tb1.text n5.value;
  }
  if (
this.started == false) {
    if (
Calculator_Tb2.text == "") {
      
Calculator_Tb2.text n5.value;
    } else 
Calculator_Tb2.text Calculator_Tb2.text n5.value;
  }
}

function 
Calculator_n6.onAction() {
  if (
this.started == true) {
    if (
Calculator_Tb1.text == "") {
      
Calculator_Tb1.text n6.value;
    } else 
Calculator_Tb1.text Calculator_Tb1.text n6.value;
  }
  if (
this.started == false) {
    if (
Calculator_Tb2.text == "") {
      
Calculator_Tb2.text n6.value;
    } else 
Calculator_Tb2.text Calculator_Tb2.text n6.value;
  }
}

function 
Calculator_n7.onAction() {
  if (
this.started == true) {
    if (
Calculator_Tb1.text == "") {
      
Calculator_Tb1.text n7.value;
    } else 
Calculator_Tb1.text Calculator_Tb1.text n7.value;
  }
  if (
this.started == false) {
    if (
Calculator_Tb2.text == "") {
      
Calculator_Tb2.text n7.value;
    } else 
Calculator_Tb2.text Calculator_Tb2.text n7.value;
  }
}

function 
Calculator_n8.onAction() {
  if (
this.started == true) {
    if (
Calculator_Tb1.text == "") {
      
Calculator_Tb1.text n8.value;
    } else 
Calculator_Tb1.text Calculator_Tb1.text n8.value;
  }
  if (
this.started == false) {
    if (
Calculator_Tb2.text == "") {
      
Calculator_Tb2.text n8.value;
    } else 
Calculator_Tb2.text Calculator_Tb2.text n8.value;
  }
}

function 
Calculator_n9.onAction() {
  if (
this.started == true) {
    if (
Calculator_Tb1.text == "") {
      
Calculator_Tb1.text n9.value;
    } else 
Calculator_Tb1.text Calculator_Tb1.text n9.value;
  }
  if (
this.started == false) {
    if (
Calculator_Tb2.text == "") {
      
Calculator_Tb2.text n9.value;
    } else 
Calculator_Tb2.text Calculator_Tb2.text n9.value;
  }
}

function 
Calculator_add.onAction() {
  if (
this.started == true) {
    
this.started false;
    
this.mode "+";
    
nPar.stated false;
    
Calculator_mode.text this.mode;
  }
}

function 
Calculator_min.onAction() {
  if (
this.started == true) {
    
this.started false;
    
this.mode "-";
    
nPar.stated false;
    
Calculator_mode.text this.mode;
  }
}

function 
Calculator_tim.onAction() {
  if (
this.started == true) {
    
this.started false;
    
this.mode "X";
    
nPar.stated false;
    
Calculator_mode.text this.mode;
  }
}

function 
Calculator_div.onAction() {
  if (
this.started == true) {
    
this.started false;
    
this.mode "/";
    
nPar.stated false;
    
Calculator_mode.text this.mode;
  }
}

function 
Calculator_C.onAction() {
  
this.mode NULL;
  
nPar.stated false;
  
this.started true;
  
Calculator_Tb1.text "";
  
Calculator_Tb2.text "";
  
Calculator_Result.text "";
  
Calculator_mode.text "";
}

function 
Calculator_equ.onAction() {
  if (
Calculator_Tb1.text == "" || Calculator_Tb2.text == "") {
    return;
  }
  if (
this.mode == "+") {
    
Calculator_Result.text Calculator_Tb1.text Calculator_Tb2.text;
  }
  if (
this.mode == "-") {
    
Calculator_Result.text Calculator_Tb1.text Calculator_Tb2.text;
  }
  if (
this.mode == "X") {
    
Calculator_Result.text Calculator_Tb1.text Calculator_Tb2.text;
  }
  if (
this.mode == "/") {
    
Calculator_Result.text Calculator_Tb1.text Calculator_Tb2.text;
  }



-------------------------------------------------
Any errors? Please tell me so I can learn. I'd Like to Thank Emera and Callimuc for all the effort they put into teaching me those. Can't thank you enough guys :)

I can't nitpick right now since I'm on my iPad and I'm not up for scripting on it, but you've learned a crapload :) good job man.

callimuc 08-18-2012 07:55 PM

Hate to complain but meh its better i gues :P

1. Yes you didnt use timevar2 on purpose but its way easier
Spoiler
PHP Code:

function onActionServerSide() {
  if (
params[0] == "echo") {
    
temp.toks player.chat.substring(6);
    if (
this.lastused+timevar2) {
      echo(
player.nick " [" player.account "] : " this.toks);
      
player.chat "Echo'd: "@temp.toks;
    }
    else 
player.chat "Please wait 5 seconds before sending an echo again";
  }
}

//#CLIENTSIDE
function onPlayerChats() {
  if (
player.chat.starts("/echo"))
    
triggerserver("gui"name"echo"player.chat.substring(6));




2. too lazy to rewrite it but you should always warp the player on serverside

3. didnt check the whole thing but seems kinda messy for me too :(


in all its pretty good but there is some stuff you should improve on like serverside checks and so on

Johnaudi 08-18-2012 08:56 PM

Quote:

Posted by Emera (Post 182351)
I can't nitpick right now since I'm on my iPad and I'm not up for scripting on it, but you've learned a crapload :) good job man.

crap? .-. Lol Ty :3

Quote:

Posted by callimuc (Post 182356)
Hate to complain but meh its better i gues :P

1. Yes you didnt use timevar2 on purpose but its way easier
Spoiler
PHP Code:

function onActionServerSide() {
  if (
params[0] == "echo") {
    
temp.toks player.chat.substring(6);
    if (
this.lastused+timevar2) {
      echo(
player.nick " [" player.account "] : " this.toks);
      
player.chat "Echo'd: "@temp.toks;
    }
    else 
player.chat "Please wait 5 seconds before sending an echo again";
  }
}

//#CLIENTSIDE
function onPlayerChats() {
  if (
player.chat.starts("/echo"))
    
triggerserver("gui"name"echo"player.chat.substring(6));




2. too lazy to rewrite it but you should always warp the player on serverside

3. didnt check the whole thing but seems kinda messy for me too :(


in all its pretty good but there is some stuff you should improve on like serverside checks and so on

@1) Ty, I'll try to use it next time.
@2) even the player.x and y?
@3) what's so messy .-.
And thanks, I'll try to redo some new ones tomorrow, can anyone give me an idea?

callimuc 08-18-2012 10:50 PM

Quote:

Posted by Johnaudi (Post 182377)
@2) even the player.x and y?

would just use setlevel

Quote:

Posted by Johnaudi (Post 182377)
@3) what's so messy .-.

some stuff which could probably be written better
also are you sure your n0-9 stuff is saved in the whole script?

Zdog 08-19-2012 03:18 AM

I still need scripters for my game did you view my thread?

callimuc 08-19-2012 03:46 AM

GS1/2 is not the same as java/python/...

Johnaudi 08-19-2012 07:13 AM

Quote:

Posted by callimuc (Post 182438)
would just use setlevel



some stuff which could probably be written better
also are you sure your n0-9 stuff is saved in the whole script?

Oh yeah, it's on the creation point, it gives the value to the Button, check down a bit. Example :
Created() n1.value = 1;
Button n1() textbox1.text = textbox1.text @ n1.value
Check the parts down and you'll understand. The calculator is working, it's just the parentheses () which have no functions.

Quote:

Posted by callimuc (Post 182601)
GS1/2 is not the same as java/python/...

Gs1 is similar to java tho.

topsamman 08-19-2012 07:19 AM

Quote:

Posted by Bulldogg Lucero (Post 182318)
Oh, well they should upgrade that :\

Wow...

Emera 08-20-2012 03:06 PM

Right, I'm back home. You've over complicated the echo message with the timeout and what not. You'll be better off using an echo like Callimuc said. Here's what I've come up with.

PHP Code:

const WAIT_TIME 5;

function 
onActionServerside() {
  switch(
params[0]) {
    case 
"echoMessage": {
      if (
clientr.msg_wait >= timevar2) {
        
player.chat "I must wait" SPC WAIT_TIME SPC "seconds!";
      } else {
        echo(
player.nick SPC "(" player.account "):" SPC params[1]);
        
clentr.msg_wait timevar2 WAIT_TIME;
      }
      break;
    }
  }
}

//#CLIENTSIDE

function onPlayerChats() {
  if (
player.chat.starts("/echo")) {
    
temp.msg player.chat.substring(6);
    
triggerServer("gui""name""echoMessage"temp.msg);
  }



callimuc 08-20-2012 03:34 PM

Quote:

Posted by Emera (Post 183195)
PHP Code:

 clentr.msg_wait timevar2 WAIT_TIME


:unsure:

Johnaudi 08-20-2012 03:47 PM

This would be easier? : (this.stoptime + 5 < timevar2) {}
Would it work? :p

callimuc 08-20-2012 03:49 PM

Quote:

Posted by Johnaudi (Post 183217)
This would be easier? : (this.stoptime + 5 < timevar2) {}
Would it work? :p

Quote:

Posted by callimuc (Post 182356)
PHP Code:

if (this.lastused+timevar2) {
  echo(
player.nick " [" player.account "] : " this.toks);
  
player.chat "Echo'd: "@temp.toks;




Emera 08-20-2012 03:50 PM

Shush you.

Johnaudi 08-20-2012 03:51 PM

Alright, then I should use your way, @Emera yours is a bit... Um.. Complex.

Emera 08-20-2012 03:52 PM

Quote:

Posted by Johnaudi (Post 183222)
Alright, then I should use your way, @Emera yours is a bit... Um.. Complex.

Not really <3 Might seem a little 'in your face' since it's new to you, but if you want me to talk you through it I'll be more than happy to.

callimuc 08-20-2012 03:53 PM

Quote:

Posted by Johnaudi (Post 183222)
Alright, then I should use your way, @Emera yours is a bit... Um.. Complex.

its pretty much the same. he just likes to use the switch and case stuff... i dont like it that much :P and the clientr.flag storage is kinda useless imo in this case

Emera 08-20-2012 04:01 PM

Quote:

Posted by callimuc (Post 183225)
its pretty much the same. he just likes to use the switch and case stuff... i dont like it that much :P and the clientr.flag storage is kinda useless imo in this case

Log out -> Log in (spam)
Oh wait it's stored serverside...
shush callimuc k?

callimuc 08-20-2012 04:02 PM

Quote:

Posted by Emera (Post 183230)
Log out -> Log in (spam)
Oh wait it's stored serverside...
shush callimuc k?

k

BboyEatsbacon 08-20-2012 05:29 PM

Quote:

Posted by Johnaudi (Post 182303)
Hey,
Got bored a bit, and don't know what to add to the scripts I made a while back. so having you guys give me an opinion would help. Also, I'm still at a learning stage to any developer feel free to correct me/teach me anything new or give me idea's or other ways to do the certain thing.
Echo from NC (Made while learning triggerserver)
  • Current usage by saying "/echo TextGoesHere"
  • Can echo from the player's chat to RC
  • Anti-Spam built (yes, I know timevar2 but I have thought of a different way)
PHP Code:

function onActionServerSide() {
  if (
params[0] == "cmd") {
    
this.toks player.chat.substring(6);
    echo(
player.nick " [" player.account "] : " this.toks);
  }
}

//#CLIENTSIDE
function onCreated() {
  
this.num 1;
}

function 
onPlayerChats() {
  if (
player.chat.starts("/echo")) {
    if (
this.num == 1) {
      
this.toks player.chat.substring(6);
      
triggerserver("gui"name"cmd");
      
sleep(0.1);
      
this.num 0;
      
setTimer(0.01);
      
player.chat "Echo'ed : " player.chat.substring(6);
    } else 
player.chat "Please wait 5 seconds before sending another Echo!";
  }
}

function 
onTimeOut() {
  if (
this.num == 0) {
    
sleep(5);
    
this.num 1;
  }
  
setTimer(0.1);



  • Just declare a flag as you go, no need for it to be under onCreated() :)
  • When checking for a flag, you can just do if (flag == true)
  • Seeing as that you're only using a timer for one thing in the script, don't have your timer set to 0.1, but rather 5 and don't have it loop within onTimeOut.
  • Using format(string, var, var) is very nice when using multiple variables to output to a string.

Fixed Version:
Spoiler

PHP Code:

function onActionServerSide() {
  if (
params[0] == "cmd") {
    
this.toks player.chat.substring(6);
    echo(
format("%s [%s] : %s"player.nickplayer.accountthis.toks);
  }
}

//#CLIENTSIDE
function onPlayerChats() {
  if (
player.chat.starts("/echo")) {
    if (
this.num == false) {
      
this.toks player.chat.substring(6);
      
triggerserver("gui"name"cmd");
      
sleep(0.1);
      
this.num true;
      
setTimer(5);
      
player.chat "Echo'ed : " player.chat.substring(6);
    } else 
player.chat "Please wait 5 seconds before sending another Echo!";
  }
}

function 
onTimeOut() {
  if (
this.num == true)
    
this.num == false;




Hopefully I could teach some neat ways to expand your scripting in this post! :)

Johnaudi 08-22-2012 07:13 PM

okay got it, Ty BBoy, the %s helped a lot.
Can't script right now since guest access cleared from Delteria, but, anyone got ideas about Particles? Graal Bible doesn't explain much but I'd love to know the basic way they work.

Billy 08-24-2012 11:47 AM

I don't get scripting,all i see is a bunch of different colored letters and numbers with symbols and shiz and its like it magically makes things in games..can someone tell me about scripting? How do you even do it in game... Where do you do it on a program and then post here?

callimuc 08-24-2012 12:02 PM

Quote:

Posted by Billy (Post 185500)
I don't get scripting,all i see is a bunch of different colored letters and numbers with symbols and shiz and its like it magically makes things in games..can someone tell me about scripting? How do you even do it in game... Where do you do it on a program and then post here?

on graal when you are staff and got the rights on a server you have access to an "extra" section where you can put weapons on. there you write these magical letters and the RC/tests will tell you if you have succeed or if you failed

here you got a pretty good guide
http://public.zodiacdev.com/index.php?title=Fowlplay4

Kavan 08-24-2012 12:50 PM

Quote:

Posted by Billy (Post 185500)
I don't get scripting,all i see is a bunch of different colored letters and numbers with symbols and shiz and its like it magically makes things in games..can someone tell me about scripting? How do you even do it in game... Where do you do it on a program and then post here?

Well, if you actually look and read through some of the scripts, you'll realise that the coloured letters will form - believe it or not - words! If you read this script line by line, you can actually get a good idea of what it is doing:

PHP Code:

//#CLIENTSIDE

function onPlayerChats() {        // If the player says something
  
if(player.chat == ":)") {        // If the player chat is ':)'
    
player.chat ":(";              // Set the player's chat to ':('
    
setTimer(.05);                   // Set a countdown timer of 0.05 seconds
  
}
}

function 
onTimeout() {            // If the timer is "out"
  
temp.posx random(064);  // Create a temporary random # in 0-64
  
temp.posy random(064);  // Same as above
  
player.temp.posx;          // Set the player's x position to the rand #
  
player.temp.posy;          // Set the player's y position to the other #
  
setTimer(.05);                    // Create another countdown timer


So, really, it's not hard to see that it's not just coloured letters. It is comprehensible somewhat, but I can understand how it looks like hieroglyphs when you stick in things like & * / % +. Those are just arithmetic operators, and perform calculations. You just have to learn which is what (for example, + is add, * is multiply), and the same goes for the words used. There are many different words (I used the description 'word' for the sake of simplicity) that you can use to do different things, again you have to learn those.

I'm going to make a crude comparison and compare the brackets used to paragraphs, and these paragraphs can only be read if the word after the keyword 'function' is performed, (ie. onPlayerChats - if the player chats, onTimeout - if the timer runs out). Therefore the second 'paragraph' can only be read if the timer runs out in the script above.

The same way you have read it is the same way the game will interpret it ie. it will read it line by line like an essay and perform what the script is telling it to do.

Hopefully now, scripting doesn't seem as frightening as it did before, and maybe you'll give it a go, because it's quite fun.

You can script on Graal by first buying a gold subscription, and then you can get access to the Testbed Server Remote Control, which you can use to script with.

プリンセスさくら2 08-24-2012 05:45 PM

i hate you john

callimuc 08-24-2012 06:12 PM

Quote:

Posted by プリンセスさくら2 (Post 185705)
i hate you john

im sure he shares your feelings

fsh 08-24-2012 06:25 PM

Quote:

Posted by callimuc (Post 185717)
im sure WE share your feelings


プリンセスさくら2 08-24-2012 06:28 PM

Quote:

Posted by callimuc (Post 185717)
im sure he shares your feelings


Hahahaha
I'm not a romantic

Emera 08-24-2012 06:29 PM

Quote:

Posted by プリンセスさくら2 (Post 185733)
Hahahaha
I'm not a romantic

You are however throwing this thread off of topic and becoming very annoying. This thread is for John to show his progress with GS2 and for us to offer feedback.

プリンセスさくら2 08-24-2012 06:41 PM

Quote:

Posted by Emera (Post 185735)
You are however throwing this thread off of topic and becoming very annoying. This thread is for John to show his progress with GS2 and for us to offer feedback.

Yes I know I am upsetting
so You do not need to say anything because I know everything about me
And why when I said I hate (hate is not something wrong):D

callimuc 08-24-2012 07:05 PM

Quote:

Posted by プリンセスさくら2 (Post 185733)
I'm not a romantic

yea lets say it was romantic

Quote:

Posted by プリンセスさくら2 (Post 185744)
Yes I know I am upsetting
so You do not need to say anything because I know everything about me
And why when I said I hate (hate is not something wrong):D

it is in this case because you are annoying the hell out of it and going off topic. either stay on topic or dont post. ez

fsh 08-24-2012 07:16 PM

Quote:

Posted by callimuc (Post 185754)
dont post

Another great idea by callimuc :)

Billy 08-24-2012 07:22 PM

Quote:

Posted by Kavan (Post 185539)
Well, if you actually look and read through some of the scripts, you'll realise that the coloured letters will form - believe it or not - words! If you read this script line by line, you can actually get a good idea of what it is doing:

PHP Code:

//#CLIENTSIDE

function onPlayerChats() {        // If the player says something
  
if(player.chat == ":)") {        // If the player chat is ':)'
    
player.chat ":(";              // Set the player's chat to ':('
    
setTimer(.05);                   // Set a countdown timer of 0.05 seconds
  
}
}

function 
onTimeout() {            // If the timer is "out"
  
temp.posx random(064);  // Create a temporary random # in 0-64
  
temp.posy random(064);  // Same as above
  
player.temp.posx;          // Set the player's x position to the rand #
  
player.temp.posy;          // Set the player's y position to the other #
  
setTimer(.05);                    // Create another countdown timer


So, really, it's not hard to see that it's not just coloured letters. It is comprehensible somewhat, but I can understand how it looks like hieroglyphs when you stick in things like & * / % +. Those are just arithmetic operators, and perform calculations. You just have to learn which is what (for example, + is add, * is multiply), and the same goes for the words used. There are many different words (I used the description 'word' for the sake of simplicity) that you can use to do different things, again you have to learn those.

I'm going to make a crude comparison and compare the brackets used to paragraphs, and these paragraphs can only be read if the word after the keyword 'function' is performed, (ie. onPlayerChats - if the player chats, onTimeout - if the timer runs out). Therefore the second 'paragraph' can only be read if the timer runs out in the script above.

The same way you have read it is the same way the game will interpret it ie. it will read it line by line like an essay and perform what the script is telling it to do.

Hopefully now, scripting doesn't seem as frightening as it did before, and maybe you'll give it a go, because it's quite fun.

You can script on Graal by first buying a gold subscription, and then you can get access to the Testbed Server Remote Control, which you can use to script with.

Thanks! I have gold I'll try it out.

Quote:

Posted by callimuc (Post 185509)
on graal when you are staff and got the rights on a server you have access to an "extra" section where you can put weapons on. there you write these magical letters and the RC/tests will tell you if you have succeed or if you failed

here you got a pretty good guide
http://public.zodiacdev.com/index.php?title=Fowlplay4

Thanks! I'll check out that guide as well.

Johnaudi 08-24-2012 09:58 PM

Quote:

Posted by Johnaudi (Post 184403)
okay got it, Ty BBoy, the %s helped a lot.
Can't script right now since guest access cleared from Delteria, but, anyone got ideas about Particles? Graal Bible doesn't explain much but I'd love to know the basic way they work.

I like colors.

Quote:

Posted by Emera (Post 185735)
You are however throwing this thread off of topic and becoming very annoying. This thread is for John to show his progress with GS2 and for us to offer feedback.

Still don't know the usage of addlocalmodifier

Quote:

Posted by プリンセスさくら2 (Post 185705)
i hate you john

Opposites attracts <3

callimuc 08-25-2012 12:34 AM

meh, newb times xD
forums.graalonline.com/forums/showthread.php?t=134263795

プリンセスさくら2 08-25-2012 02:32 AM

Quote:

Posted by callimuc (Post 185754)
yea lets say it was romantic


Why
Do you want me to become a romantic like you?? :love::love::rolleyes:
Hahaha considered this nothing is impossible :love::smile:

Sup3rn00b 08-25-2012 02:36 AM

Quote:

Posted by プリンセスさくら2 (Post 185705)
i hate you john

lolwhy

プリンセスさくら2 08-25-2012 02:40 AM

Quote:

Opposites attracts <3
i will not be attracted to you, because I do not see the dinosaurs attractive

Quote:

Posted by Sup3rn00b (Post 185999)
lolwhy

because He like dinosaur

Sup3rn00b 08-25-2012 02:47 AM

Quote:

Posted by プリンセスさくら2 (Post 186000)
because He like dinosaur

So your a dino hater?

プリンセスさくら2 08-25-2012 02:47 AM

He dinosaur Lebanon hahaha

Sup3rn00b 08-25-2012 02:52 AM

I am very confused.

プリンセスさくら2 08-25-2012 03:04 AM

Quote:

Posted by Sup3rn00b (Post 186014)
I am very confused.

Go to the temple and pray
And will not become confused

Johnaudi 08-25-2012 07:05 AM

Quote:

Posted by プリンセスさくら2 (Post 186007)
He dinosaur Lebanon hahaha

Uhm? I'm basically from the U.S but moved to Lebanon, and my last post was sarcasm lol.

Quote:

Posted by callimuc (Post 185958)
meh, newb times xD
forums.graalonline.com/forums/showthread.php?t=134263795

Ty <3

@Callimuc, so it mainly makes the particle movement or ,as it's said, "replace" the alpha to make it 0 smoothly without sudden death? I want more basically the creation of each particle as a sprite. Is that in a Gani editor or something?

プリンセスさくら2 08-25-2012 07:35 AM

Quote:

Posted by Johnaudi (Post 186148)
Uhm? I'm basically from the U.S but moved to ?

Well you dinosaur Lebanon
I can call you dinosaur Lebanon or America or Japan (i am free)
But I have a question
Do you tasted Homs or Flavell (Flavell and Homs food Arabic at what i think)

Johnaudi 08-25-2012 09:22 AM

Quote:

Posted by プリンセスさくら2 (Post 186157)
Do you tasted Homs or Flavell (Flavell and Homs food Arabic at what i think)

Don't want to go off topic, but yeah. Btw what does "Dinosaur" have to do with my country .-.? You people scare me.

Talon 08-25-2012 09:24 AM

I wish I knew how to script. I gave it a shot, but in the end, it wasn't for me. I commend you for going through with it and learning with the help of Emera and Callimuc. Good job.

callimuc 08-25-2012 10:44 AM

Quote:

Posted by Johnaudi (Post 186148)
@Callimuc, so it mainly makes the particle movement or ,as it's said, "replace" the alpha to make it 0 smoothly without sudden death? I want more basically the creation of each particle as a sprite. Is that in a Gani editor or something?

Yea. Without that the particles would only move to the angle you have setted (if you didnt set any its 0 so it would move to that angle). You can do different stuff with that, like reducing/rising the alpha of the particle after a certain ammount of seconds withing a certain ammount of seconds (like start lowering the alpha after 3 seconds from 1 to 0 within 0.5 seconds). same can be done with the movement (changing the x/y, angle, ...) and more.

An example for your alpha thing would be:
(SCRIPT and SCRIPTEND is because i prefer to do particle effects as gani scripts. simply put that into a gani and save it as something like "john_particletest.gani" and put that into the players/objects attribute/set it as an ani; can be done like player.attr[2] = "ganiname.gani"; or setAni("ganiname", params))
(the script is an old one of mine i practiced with when i first made particles so it might not be perfect. i barely make them :P)
PHP Code:

SCRIPT
function onPlayerEnters() {
  
onTimeOut();
}

function 
onTimeOut() {
  
with(findimg(200)) {
    
player.0.25//starting x
    
player.3.00//starting y
    
attachtoowner true//follow the object if it moves (like follow the player if you move?
    
layer 3//layer

    
with(emitter) {
      
delaymin 0.3//the minimum delay when they should spawn
      
delaymax 0.3//the maximum delay when they should spawn
      
maxparticles  20//how many particles will be spawned max. until its recalled (timeout in this case)
      
nrofparticles 1//how many particles will be spawned at once

      
with(particle) {
        
speed 10//particles movement speed
        
lifetime 4//how many seconds will you be able to see the particle?
        
image "g4_particle_bluex.png"//particles image; works with ani = "walk"; aswell I think (so you can also set ganis)
        
red   random(01); //red value
        
green random(01); //green value
        
blue  random(01); //blue value
        
alpha 1//alpha value
        
zoom  random(0.30.5); //the size of the particle (by default its always 1 - original size)
        
mode  0//mode effect of the particle
        
spin  random(12); //rotation of the particle
        
angle random(80); //particles angle (in which direction it will move)
      
}

      
continueafterdestroy true//if the particle is destroyed/removed from a script, should the particle be removed immediately aswell (false) or have the particles finish their lifetime (true)?
      
addLocalModifier("range"24"alpha""replace"10); //lower the alpha after 2 seconds to the 4th second (so within 2 seconds; 4 is also the lifetime so when the particle is alpha=0 it will be destroyed - avoids lag)      addLocalModifier("range", 0, 6, "angle", "replace", (pi*2)*4, 0); //rotation angle for the particle (from the second 0 to 6 because it will affect the size of the "ring")
    
}
  }
  
setTimer(4);
}
SCRIPTEND 

Quote:

Posted by Mark Sir Link
addlocalmodifier(type, rangemin, rangemax, variable, variable modification, valuemin, valuemax)

Types - once, impulse, range - modifies the particle one time, periodically or only in the given time range
rangemin - seconds, minimum delay until first modification or start of modification range (if modifier is "range")
rangemax - seconds, maximum delay until first modification or end of modification range (if modifier is "range")
variable - x,y,z,movex,movey,movez,angle,zangle,speed,rotatio n,spin,stretchx,stretchy,red,green,blue,alpha or zoom
variable modification type - replace,add or multiply (if modifier type is "range" then only "replace" and "add" are valid)
valuemin - range start of the random value or first value to set/add (if modifier is "range")
valuemax - range end of the random value or last value to set/add (if modifier is "range")

from http://wiki.graal.net/index.php/Part...icle_modifiers

All i can suggest you is to read the source Mark Sir Link posted. can help pretty much


All times are GMT. The time now is 07:07 AM.

Powered by vBulletin/Copyright ©2000 - 2025, vBulletin Solutions Inc.