Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-24-2006, 06:29 PM
michael7849 michael7849 is offline
Playerworld21 Manager
Join Date: Aug 2006
Posts: 81
michael7849 is an unknown quantity at this point
Human controller Kinda abusive

hi this is mike and heres a code for you all a controller a little buggy but gets the point around (i use to for the ppl that are liek speed hacking and stuff and make them walk to te jail


PHP Code:
function onActionServerside(cmdplayerdirection)
  {
  
pl findplayer(params[1]);
  
with (pl) {
    if (
cmd == "on"freezeplayer2();
    if (
cmd == "off"unfreezeplayer();
    if (
cmd == "ani"setani(params[2],params[3]);
    if (
cmd == "chat"pl.chat params[2];
    if (
cmd == "move")
      {
      if (
direction == 0)
        {
        
this.speed .45;
        
pl.-= this.speed;
        
pl.dir 0;
        
setani("walk","");
        
sleep(.30);
        
setani("idle","");
      }
      if (
direction == 2)
        {
        
pl.+= this.speed;
        
pl.dir 2;
        
setani("walk","");
        
sleep(.30);
        
setani("idle","");
      }
      if (
direction == 3)
        {
        
pl.+= this.speed;
        
pl.dir 3;
        
setani("walk","");
        
sleep(.30);
        
setani("idle","");
      }
      if (
direction == 1)
        {
        
pl.-= this.speed;
        
pl.dir 1;
        
setani("walk","");
        
sleep(.30);
        
setani("idle","");
      }
    }
  }
}
//#CLIENTSIDE

function onMouseDown(button)
  {
  if(
button == "double")
    {
    
temp.pl GetPlayer(mousex,mousey);
    
this.ctrl temp.pl;
    
with(findImg(200)) {
      
text "Mind Control:" SPC temp.pl SPC "press (c) to control and stop controlling";
      
font "Tempus Sans ITC";
      
style "b";
      
zoom 0.6;
      
screenwidth gettextwidth(zoomfontstyletext) - 220;
      
135;
      
layer 5;
    }
    
    for(
temp.i=0;temp.i<4;temp.i++) {
      
with(findImg(201+temp.i)) {
        
text findImg(200).text;
        
font findImg(200).font;
        
style findImg(200).style;
        
zoom findImg(200).zoom;
        
findImg(200).vecx(temp.i);
        
findImg(200).vecy(temp.i);
        
layer 4;
        
        
red 0;
        
green 0;
        
blue 0;
        
alpha 1;
      }
    }
    
with(findImg(206)) {
      
text findImg(200).text;
      
font findImg(200).font;
      
style findImg(200).style;
      
zoom findImg(200).zoom;
      
findImg(200).2;
      
findImg(200).2;
      
layer 4;
      
      
red 0;
      
green 0;
      
blue 0;
      
alpha 1;
    }
    if (
this.ctrl == NULLhideimgs(200,300);
  }
}

function 
GetPlayer(tXtY) {
  for(
temp.i=0;temp.i<players.size();temp.i++) {
    
//return players[i].account;
    
if(tX in |players[i].x,players[i].x+3| && tY in |players[i].y,players[i].y+3|) {
      if(
players[i].account != player.account) {
        return 
players[i].account;
      } else {
        return 
"";
      }
    }
  }
  return 
"";
}


function 
onPlayerChats()
  {
  if (
this.on == 1)
    {
    
triggeraction(0,0,"serverside"#N,"chat",this.ctrl,player.chat);
    
player.chat "";
  }
}

function 
onKeyPressed(keycharcharacter)
  {
  if (
this.on == 1)
    {
    
//this.msg = this.msg@character; 
    
if (keychar == 13
    {
      
onCtrlBar();
      
//triggeraction(0,0,"serverside", #N,"chat",this.ctrl,this.msg);
      //this.msg = "";
    
}
    if (
character == "a"triggeraction(0,0,"serverside"#N,"ani",this.ctrl,"grab");
    
if (character == "h"
    {
       
showimg(1,"emoticon_heart.png",pl.2,pl.5);
       
changeimgvis(1,2);
       
sleep(.30);
       
onTimeout();
       
hideimg(1);
    }
    if (
character == "s"triggeraction(0,0,"serverside"#N,"ani",this.ctrl,"sword");
  
}
  if (
character == "c")
    {
    
onTimeout();
    if (
this.ctrl != NULL)
      {
      
this.on = !this.on;
      if (
this.on 0)
        {
        
hideimgs(200,300);
        
resetfocus();
        
triggeraction(0,0,"serverside"#N,"off",this.ctrl);
        
this.ctrl NULL;
      }else {
        
setani("idle","");
        
triggeraction(0,0,"serverside"#N,"on",this.ctrl);
      
}
    }
  }
}

function 
onTimeout()
  {
  if (
this.on == 1)
    {
    
ChatBar.visible false;
    
disabledefmovement();
    for (
i=0;i<4;i++;)
      {
      if (
keydown(i))
        {
        
triggeraction(0,0,"serverside"#N,"move",this.ctrl,i);
      
}
    }
    
pl findplayer(this.ctrl);
    
setfocus(pl.x,pl.y);
  }else 
enabledefmovement();
  
setTimer(.05);
}

function 
onCtrlBar()
{
  new 
GuiTextEditCtrl(Chat_bar) { 
    
profile =     profile "GuiBlueTextEditProfile";
    
horizSizing "width";
    
vertSizing "top";
    
position "100 370";
    
extent "488 20";
    
historySize 100;
    
tabComplete true;
  }
}

function 
Chat_bar.onAction()
{
  
triggeraction(0,0,"serverside"#N,"chat",this.ctrl,Chat_bar.text);
  
Chat_bar.destroy();

Attached Thumbnails
Click image for larger version

Name:	mind control.PNG
Views:	561
Size:	208.5 KB
ID:	39035  
__________________
Graal Account: michael7849
Graal Nick: element
AIM: Garbagemonkey32
MSN: [email protected]
Email: [email protected]
Server: Playerworld21

PRIVATE MESSAGE ME HERE

Buddy me

My profile

Last edited by Darlene159 : Today at 12:30AM. Reason: Added more spam to your post.

Stefan you need to read your pms more...

G OTO MY myspace.com/mikeandu

YES I AM EMO/GOTH
Reply With Quote
  #2  
Old 12-24-2006, 07:12 PM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
I can already spot problems in your script.

Check your trigger actions
Reply With Quote
  #3  
Old 12-24-2006, 09:41 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
I've seen scripts like this on many servers.. kind of annoying
__________________
Reply With Quote
  #4  
Old 12-25-2006, 04:02 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
This was like the NAT test on some server: "Tell me what this script does".
Reply With Quote
  #5  
Old 12-25-2006, 04:07 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
These kind of scripts should be banned from Graal..
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #6  
Old 12-25-2006, 04:14 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by xXziroXx View Post
These kind of scripts should be banned from Graal..
Well...I'd be happy if it changed the victims guild to 'Being Controlled by' then whoever. Otherwise, i foresee bad events as a result of this NPC.
Reply With Quote
  #7  
Old 12-25-2006, 04:29 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Twinny View Post
Well...I'd be happy if it changed the victims guild to 'Being Controlled by' then whoever. Otherwise, i foresee bad events as a result of this NPC.
I just find them abusive, and theres no need for it what so ever.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #8  
Old 12-25-2006, 04:51 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
I'm thinking it could be used like Abe's Odyssey. Temporarily control a player to get them to do something for you. It would be alright if it only worked in the same level and it was very clear that the person was being controlled. Should also have a massive cool down and a short span of active control.

Not a staff tool though.
Reply With Quote
  #9  
Old 12-25-2006, 04:55 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Twinny View Post
I'm thinking it could be used like Abe's Odyssey. Temporarily control a player to get them to do something for you. It would be alright if it only worked in the same level and it was very clear that the person was being controlled. Should also have a massive cool down and a short span of active control.

Not a staff tool though.
Its the whole *staff tool* part thats bothering me.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #10  
Old 01-03-2007, 05:43 PM
Zanzel Zanzel is offline
<insert title here>
Zanzel's Avatar
Join Date: Dec 2006
Posts: 35
Zanzel is on a distinguished road
Staff tools are useless really, If you go to each and every Playerworld<#>
you will find atleast 1 or so Staff tools..
That either:
Add money, Freeze players, kill players, etc.

I am agreeing with Ziro, for he is right.. They should be banned from graal.
Reply With Quote
  #11  
Old 01-04-2007, 07:04 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
The one I created does more than that (Yes it does do that though). It can change the staff RC head, modify player vars, constantly checks and logs all action the staff uses so on and so forth

Basically "I" don't find them useless.

This is probaly Micheal first Script so quit being so negative about it. :o
__________________
Deep into the Darkness peering...
Reply With Quote
  #12  
Old 01-05-2007, 07:00 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Angel_Light View Post
The one I created does more than that (Yes it does do that though). It can change the staff RC head, modify player vars, constantly checks and logs all action the staff uses so on and so forth

Basically "I" don't find them useless.

This is probaly Micheal first Script so quit being so negative about it. :o
If it IS his first script, its just AWESOME to start with the most abusive thing you can script - shows great promises for the future!
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #13  
Old 01-05-2007, 07:05 PM
kia345 kia345 is offline
z0rbi 4 life 🤘
kia345's Avatar
Join Date: Dec 2006
Location: delteria
Posts: 6,737
kia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond repute
michael you didnt make that -.-
hikaru and mark did back on horizon
__________________
pojo
Reply With Quote
  #14  
Old 01-21-2007, 07:00 AM
konidias konidias is offline
Old Bee
konidias's Avatar
Join Date: Jul 2001
Location: Orlando, FL
Posts: 7,222
konidias will become famous soon enough
Send a message via AIM to konidias
Quote:
Originally Posted by Zanzel View Post
Staff tools are useless really, If you go to each and every Playerworld<#>
you will find atleast 1 or so Staff tools..
That either:
Add money, Freeze players, kill players, etc.

I am agreeing with Ziro, for he is right.. They should be banned from graal.
It's when a server has more staff tool weapons than actual game weapons that you know the server is doomed.
__________________

Put this image in your sig if you support Bomy Island! (g2k1 revision)
play bomberman while you wait!


Reply With Quote
  #15  
Old 01-21-2007, 07:45 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Any server I help on, I try to convince the manager/owner to remove such tools. They are gimmicks and serve only to waste time and piss other staff members / players off.
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 03:51 PM.


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