Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   Speed Sandals (https://forums.graalonline.com/forums/showthread.php?t=134264627)

Emera 09-24-2011 07:05 PM

Speed Sandals
 
1 Attachment(s)
Just another staff boot script, but with a difference that I hope the users will find quite pleasant. It has an image / text display in the top right corner of your screen that shows your speed. You can increase speed by pressing + and otherwise decrease it by pressing -. Here is the script.
PHP Code:

//#CLIENTSIDE
function onKeyPressed(codeKey) {
  if (
Key == "z") {
    
setTimer(0.05);
    if (
this.mode == 0) {
      
this.mode 1;
      
this.speed 1;
    } else {
      
this.mode 0;
    }
  }
  if (
Key == "=") {
    
this.speed this.speed 1;
  }
  if (
Key == "-") {
    
this.speed this.speed 1;
  }
}

function 
onTimeout() {
  if (
this.mode == 1) {
    
showingimage();
    for (
temp.key 0key 4key++) {
      if (
keydown(key)) {
        
player.+= (vecx(key) * this.speed);
        
player.+= (vecy(key) * this.speed);
      }
    }
  }
  if (
this.mode == 0) {
    
hidingimage();
  }
  
setTimer(0.05);
}

function 
ShowingImage() {
  
with(findimg(200)) {
    
image "wboots.png";
    
layer 4;
    
screenwidth 675;
    
screenheight 610;
  }
  
with(findimg(201)) {
    
text "Speed: " thiso.speed;
    
screenwidth 638;
    
screenheight 601;
    
zoom 0.7;
    
layer 4;
    
style "bi";
    
textshadow true;
    
font "Tempsitc";
  }
}

function 
HidingImage() {
  
hideimg(200);
  
hideimg(201);



cbk1994 09-24-2011 07:15 PM

If the boots are turned off you should stop the timeout, there's no reason to keep it running every 0.05 seconds (even if it's not doing anything except constantly hiding the images). You can also use hideimgs(200, 201) to hide a range of images.

Something like this:
PHP Code:

function onKeyPressed(temp.codetemp.key) {
  if (
temp.key == "z") {
    
this.on = ! this.on// better to use booleans instead of integers for clarity
    
    
if (this.on) {
      
this.ShowingImage();
      
this.trigger("timeOut"); // this.setTimer(0.05) or this.onTimeOut() is also acceptable
    
} else {
      
this.HidingImage();
      
this.setTimer(0);
    }
  } else if (
temp.key == "=") {
    
// etc
  
}


You might also want to only show the images once (when the boots are turned on), and redraw them only when the screen resizes. You can then do

PHP Code:

findImg(201).text "Speed: " this.speed

after changing the boot speed.

Emera 09-24-2011 07:39 PM

I tried using hideimgs(); but foolishly I was doing something like
PHP Code:

hideimgs(200 201); 

and was stumped at why it wasn't working LOL. Thanks for the help though.

cbk1996 09-25-2011 05:41 PM

I would definitely suggest stopping the timeout, but you could also use the return handle to retrieve the MD5 hash to stop it as well. Perhaps setTimer(0) would work as well? Who knows.

Emera 09-25-2011 05:54 PM

I am going to let you in on 3 little secrets, ok?

1) Your fake cbk is so sad it is unreal.
2) I bet you don't even now what MD5 is.
3) I want you to GTFO

Leave now or we will make you leave. (Or a MOD will ban you for impersonating another member)

Hezzy002 09-25-2011 06:33 PM

Quote:

Originally Posted by Emera (Post 1669106)
I am going to let you in on 3 little secrets, ok?

1) Your fake cbk is so sad it is unreal.
2) I bet you don't eve now what MD5 is.
3) I want you to GTFO

pwn'd!!

cbk1996 09-25-2011 08:13 PM

Quote:

Originally Posted by Emera (Post 1669106)
I am going to let you in on 3 little secrets, ok?

1) Your fake cbk is so sad it is unreal.
2) I bet you don't even now what MD5 is.
3) I want you to GTFO

Leave now or we will make you leave. (Or a MOD will ban you for impersonating another member)

It seems like your script is returning NULL! Gah. Open up the tar ball and extract the encrypted HASH hexadecimal encryption to bypass the surmounted excess of memory.

That should do it. If it doesn't work, post your errorlog.txt into a forum post.

Emera 09-25-2011 09:01 PM

Quote:

Originally Posted by cbk1996 (Post 1669129)
It seems like your script is returning NULL! Gah. Open up the tar ball and extract the encrypted HASH hexadecimal encryption to bypass the surmounted excess of memory.

That should do it. If it doesn't work, post your errorlog.txt into a forum post.

Now, I am getting sick to death of you. Post your crap on another site, we really don't want it. You impersonate a valued member of these forums, act like a tart, post spam and useless posts on other peoples threads and have the IQ of a 3 year old. Please, give it a rest.

callimuc 09-25-2011 10:39 PM

Quote:

Originally Posted by Emera (Post 1669020)
I tried using hideimgs(); but foolishly I was doing something like
PHP Code:

hideimgs(200 201); 


Isnīt it
PHP Code:

hideimgs(200201); 

:confused:

Emera 09-25-2011 10:45 PM

Yes. I said I tried it. I figured it out ya know <3


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

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