Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Heh my bum bot, a class, decides to quit working after a while (https://forums.graalonline.com/forums/showthread.php?t=52326)

Gman4pwnu 04-16-2004 02:58 AM

Heh my bum bot, a class, decides to quit working after a while
 
Well my remote control bum works for a couple seconds(random short couple seconds), and im not sure why it just stops working. basically help.
NPC Code:

if (playerchats&&strequals(#c,/bum boom)&&strequals(#a,gman4pwnu)){
destroy;
}

if (created){
setshape 1,32,48;
}

if (actionmoveplace){
if (strequals(#p(0),up)){
dir=0;
setcharani walk,;
move 0,-.8,.1,;
sleep .1;
setcharani idle,;
} else
if (strequals(#p(0),left)){
dir=1;
setcharani walk,;
move -.8,0,.1,;
sleep .1;
setcharani idle,;
} else
if (strequals(#p(0),down)){
dir=2;
setcharani walk,;
move 0,.8,.1,;
sleep .1;
setcharani idle,;
} else
if (strequals(#p(0),right)){
dir=3;
setcharani walk,;
move .8,0,.1,;
sleep .1;
setcharani idle,;
}
}

//#CLIENTSIDE
if (created) {
setshape 1,32,48;
showcharacter;
setcharprop #3,head13.png;
setcharprop #C0,orange;
setcharprop #C1,gray;
setcharprop #C2,gray;
setcharprop #C3,white;
setcharprop #C4,lightgray;
setcharprop #n,Bum;
setcharprop #2,no-shield.gif;
shieldpower = 1;
dir = 2;
timeout=.05;
}

if (timeout){
if (strequals(#a,gman4pwnu)){
if (keydown(0)){
triggeraction x+.5,y+.5,moveplace,up;
} else
if (keydown(1)){
triggeraction x+.5,y+.5,moveplace,left;
} else
if (keydown(2)){
triggeraction x+.5,y+.5,moveplace,down;
} else
if (keydown(3)){
triggeraction x+.5,y+.5,moveplace,right;
}
}
timeout=.1;
}



osrs 04-16-2004 03:07 AM

Quote:

Rules:

1) Don't post here just asking for scripts, or asking for people to fix scripts that are beyond your skill level. The posters here aren't just some handy resource for scripting shortcuts. If you can't script something then don't try to produce it. If you're trying to make it to aid your learning then set your sights lower. If you want it for a server then go get a NAT. Likewise, don't post whole scripts for people. Post wordy solutions, certainly, but not things that people can just copy & paste into their levels without any effort.
Follow the rules. You will never learn if you always runs here and post your whole script and tell people to fix it. x-x'

Note: Remember that minimum timeout that can be used client-side is 0.05;

Gman4pwnu 04-16-2004 03:12 AM

i didn't know .10 is below .05.

before trying to make me look like an idiot, look at what you typed or you might just be doin that to yourself.

oh and go to atrius, yea, look at every script there, just about every single script created by me excluding the gang system and several guns. Im pretty sure this is my skill level. What im not understanding is why does the timeout quit working after a while.

Im not asking to fix it, tell me where I said that, im asking why it stops working.

DarkShadows_Legend 04-16-2004 03:44 AM

NPC Code:
sleep real;


That tends to break a lot of my loops so I use a different method for slowing down instead of using sleep now.
I don't know if that is the problem though. Maybe someone can comment on that.

screen_name 04-16-2004 03:52 AM

Quote:

Originally posted by Gman4pwnu
i didn't know .10 is below .05.

before trying to make me look like an idiot, look at what you typed or you might just be doin that to yourself.
Enough said?

Gman4pwnu 04-16-2004 04:09 AM

I removed the sleep but it still doesn't work right. Its a Class just so you know

DIABLO2099 04-16-2004 05:05 AM

NPC Code:
triggeraction x+.5,y+.5,moveplace,,up;


Hm, try doing that. (Remember to switch the others as well.)

Gman4pwnu 04-16-2004 05:25 AM

and how would this change anything? Besides making me change all my parameters #'s and adding a comma in each trigger action it did absolutely nothing.

DIABLO2099 04-16-2004 05:43 AM

No, don't change the parameter numbers in the actions serverside. I've tried something like this before and the script didn't recognize the position where the weapon paremeter is as the parameter with the index 0, just something to try >.>.

Gman4pwnu 04-16-2004 06:44 AM

It really didn't change anything except that It wont move with diff param number than triggeraction param position. What it does how i have it, is it goes for a random amount of seconds works perfect, then it says FU i quit.

R0bin 04-16-2004 08:34 AM

that whole thing could be serversided.
have a serverside loop of maybe 1 or 2 seconds, and make it getplayer(youraccount) and just make thiso.newdir=playerdir; then outside the with, have a function with like
move vecx(thiso.newdir),vecy(thiso.newdir),0.5,1;

Gman4pwnu 04-16-2004 09:08 AM

Strange, setting it to move by .5 or 1 or 2, it never froze.

Spark910 04-16-2004 02:09 PM

hmm.. why do you need/want a 'bum bot'

VeX_RaT_Boy 04-16-2004 02:53 PM

Quote:

Originally posted by Gman4pwnu
Strange, setting it to move by .5 or 1 or 2, it never froze.
That's what I told you on AIM! Serverside the coordinates is only every .5 (0.5, 1, 1.5, 2, 2.5 and so on)....So that's why.

Gman4pwnu 04-16-2004 06:52 PM

Yes i know, sorry I forgot to give you credit, but thanks so much! Now I can work on my car.

osrs 04-16-2004 07:00 PM

Quote:

Originally posted by Gman4pwnu
i didn't know .10 is below .05.
Eh, i misread the number.

Quote:


before trying to make me look like an idiot, look at what you typed or you might just be doin that to yourself.

That was not my intention, i was just trying you make you use your brain, by the way, i think you are an idiot now, because you seem to do not like to use your brain. (If you have one)

Quote:


oh and go to atrius, yea, look at every script there, just about every single script created by me excluding the gang system and several guns. Im pretty sure this is my skill level. What im not understanding is why does the timeout quit working after a while.

Oh yea, you seem to be a great scripter. :rolleyes:

Quote:


Im not asking to fix it, tell me where I said that, im asking why it stops working.

You should have posted the part that you think that is bugging, not the whole code?

Gman4pwnu 04-16-2004 07:09 PM

String Based Item System, Drop System, Inventory System, HP System, Day Night System, in works a movement system, A swear filter that I scrapped, Housing System using database, Item sell class, Safes using database, Stocking item class, Stocking using database, a lottery, a working car thats a class.

A few of the things i did on atrius.... Either help or **** off, thanks.

osrs 04-16-2004 07:11 PM

Quote:

Originally posted by Gman4pwnu
String Based Item System, Drop System, Inventory System, HP System, Day Night System, in works a movement system, A swear filter that I scrapped, Housing System using database, Item sell class, Safes using database, Stocking item class, Stocking using database, a lottery, a working car thats a class.

A few of the things i did on atrius.... Either help or **** off, thanks.

I tried to help with a suggestion, but your ignorance failed to notice.
Ow, lots of systems, congratulations. :)

screen_name 04-16-2004 09:47 PM

Quote:

Originally posted by Gman4pwnu
String Based Item System, Drop System, Inventory System, HP System, Day Night System, in works a movement system, A swear filter that I scrapped, Housing System using database, Item sell class, Safes using database, Stocking item class, Stocking using database, a lottery, a working car thats a class.

A few of the things i did on atrius.... Either help or **** off, thanks.


You've scripted all these things, but yet, you are still unable to find your own problems, that aren't that complex?

Dach 04-16-2004 09:59 PM

meh, you really ought to learn how to debug

go into the offline editor(if you're afraid of killing the npc server) and try things out before calling it quits

screen_name 04-16-2004 10:01 PM

Another thing also, learn how to optimize your scripts. The above script could use that.

Gman4pwnu 04-17-2004 08:46 AM

hey chad, I go into offline mode a lot, and use the test button and the style button. Screen_name, i doubt you even script ive never seen a post of yours on this forum, then again i havn't looked here in a while.

WanDaMan 04-17-2004 01:01 PM

Quote:

Originally posted by Gman4pwnu
hey chad, I go into offline mode a lot, and use the test button and the style button. Screen_name, i doubt you even script ive never seen a post of yours on this forum, then again i havn't looked here in a while.
he's one of the best scriptors on graal *****.. well in my opinion he is :\
don't say crap without looking in previous posts, atleast he knows how to do timeout's correctly

VeX_RaT_Boy 04-17-2004 01:16 PM

Quote:

Originally posted by Gman4pwnu
hey chad, I go into offline mode a lot, and use the test button and the style button. Screen_name, i doubt you even script ive never seen a post of yours on this forum, then again i havn't looked here in a while.
Lol, that was stupid said.

screen_name 04-17-2004 03:45 PM

Quote:

Originally posted by Gman4pwnu
hey chad, I go into offline mode a lot, and use the test button and the style button. Screen_name, i doubt you even script ive never seen a post of yours on this forum, then again i havn't looked here in a while.
You know why you don't see me asking questions often? Well, I actually debug my scripts until I find what's wrong. I do need help every once in a while, but very rarely.

Dach 04-17-2004 05:59 PM

Quote:

Originally posted by Gman4pwnu
hey chad, I go into offline mode a lot, and use the test button and the style button. Screen_name, i doubt you even script ive never seen a post of yours on this forum, then again i havn't looked here in a while.
wasn't meant to be demeaning, or assumptuous.. I mean that alot of the questions you ask could be solved with some good debugging. Debugging isn't a simple task either, it involves rather complex problem solving skills that separate the men from the boys in programming (so to speak). Oh, using the test button and style button isn't really debugging :|. I know you do more, but you're digging yourself deeper with that.

Meh, you don't need to chastize any scripter who will come unannounced and say something like screen_name has. I don't pretend to know all the scripters on graal, so don't throw your neck out like that. ;)

Gman4pwnu 04-17-2004 08:37 PM

Quote:

Originally posted by WanDaMan

he's one of the best scriptors on graal *****.. well in my opinion he is :\
don't say crap without looking in previous posts, atleast he knows how to do timeout's correctly

You truly are a ****ing *****, maybe if you read, you would see that there was NOTHING WRONG WITH THE TIMEOUT loop. ****in ****.

Gman4pwnu 04-17-2004 08:45 PM

I need a mod to close this thread, nothing good is coming from it now, just a flame war starting. my question has been answered, close it.

Python523 04-17-2004 09:02 PM

Quote:

Originally posted by Gman4pwnu
I need a mod to close this thread, nothing good is coming from it now, just a flame war starting. my question has been answered, close it.
If you continue to cuss and swear in all your threads when you get frustrated I will request for this forum to be screened from you.


All times are GMT +2. The time now is 06:08 AM.

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