Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Bot (https://forums.graalonline.com/forums/showthread.php?t=12176)

Merlin 09-18-2001 04:06 AM

Bot
 
I made this bot outline because i was bored and decided to post to learn from/ make fun off ;D etc etc so feel free to modifiy it, it's default.
//NPC Made by Merlin
if (created) {
showcharacter;
setcharprop #3,head0.gif;
setcharprop #C0,orange;
setcharprop #C1,white;
setcharprop #C2,blue;
setcharprop #C3,red;
setcharprop #C4,black;
setcharprop #2,shield1.gif;
shieldpower = 1;
dir = 2;
this.loaded = true;
setcharprop #n,Default Bot;
setstring this.life,3;
timeout = .5;
}
if (timeout) {
message #s(this.life);
timeout=.5;
}
if (playertouchsme) {
if (playerdir==0) {
say2
Commands:#b
Shoot - Make Bot Shoot if loaded#b
Reload - Reload the bot's shot#b
Walk Up - walk up#b
Walk Down - walk down#b
Walk Left - walk left#b
Walk Right - walk right#b
Show Stats - Show the current Stats#b
of Bot#b
}
}
if (playerchats&&strequals(#c,show stats)) {
say2
Current Bot Stats:#b
Current bot life: #s(this.life)#b
}
if (playerchats&&strequals(#c,shoot)) {
if (this.loaded==true) {
setcharani shoot,;
shootarrow dir;
this.loaded = false;
}
}
if (playerchats&&strequals(#c,reload)) {
this.loaded = true;
}
if (playerchats&&strequals(#c,walk up)) {
walkup();
}
if (playerchats&&strequals(#c,walk down)) {
walkdown();
}
if (playerchats&&strequals(#c,walk left)) {
walkleft();
}
if (playerchats&&strequals(#c,walk right)) {
walkright();
}
function walkup() {
dir = 0;
setcharani walk,;
y=y-.5;
sleep.3;
y=y-.5;
sleep.3;
y=y-.5;
sleep.3;
y=y-.5;
sleep.3;
y=y-.5;
sleep.3;
y=y-.5;
sleep.3;
setcharani idle,;
}
function walkdown() {
dir = 2;
setcharani walk,;
y=y+.5;
sleep.3;
y=y+.5;
sleep.3;
y=y+.5;
sleep.3;
y=y+.5;
sleep.3;
y=y+.5;
sleep.3;
y=y+.5;
sleep.3;
setcharani idle,;
}
function walkleft() {
setcharani walk,;
dir = 1;
x=x-.5;
sleep.3;
x=x-.5;
sleep.3;
x=x-.5;
sleep.3;
x=x-.5;
sleep.3;
x=x-.5;
sleep.3;
x=x-.5;
sleep.3;
setcharani idle,;
}
function walkright() {
setcharani walk,;
dir = 3;
x=x+.5;
sleep.3;
x=x+.5;
sleep.3;
x=x+.5;
sleep.3;
x=x+.5;
sleep.3;
x=x+.5;
sleep.3;
x=x+.5;
sleep.3;
setcharani idle,;
}
if (washit) {
setstring this.life,#v(strtofloat(#s(this.life))-1);
timeout = .5;
}
if (wasshot) {
setstring this.life,#v(strtofloat(#s(this.life))-1);
timeout = .5;
}
if (timeout) {
if (strequals(#s(this.life),0)){
sprite = 40;
timeout = 1;
setstring this.life,3;
setcharani idle,;
timeout=.5;
}
}
if (timeout) {
if (strequals(#s(this.life),-1)){
setstring this.life,0;
}
}
if (timeout) {
if (strequals(#s(this.life),-2)){
setstring this.life,0;
}
}
if (timeout) {
if (strequals(#s(this.life),-3)){
setstring this.life,0;
}
}
if (timeout) {
if (strequals(#s(this.life),-4)){
setstring this.life,0;
}
}

ownerofbabylon 09-18-2001 04:14 AM

wow thats nice, and that can be used on free PWs to cause it uses the ganis for free PWs right?

Merlin 09-18-2001 04:45 AM

yeah it only has single frame ganis but not just free because you can use anything on pay and just single on free so it can be used on either

Merlin 09-18-2001 04:53 AM

Sorry :(

Merlin 09-18-2001 04:55 AM

ok there

Merlin 09-18-2001 05:01 AM

:\

AlexH 09-18-2001 05:02 AM

move is a great command
cant remember how i found it though

ownerofbabylon 09-18-2001 07:55 AM

i dont like it

Faheria_Admin5 09-18-2001 08:25 AM

Move is nice.

Xaviar 09-19-2001 05:37 AM

Quote:

Originally posted by Kaimetsu


Didn't take me long.

Oooo...Will you be my friend?? Ive been trying to figure out pathfinding for a bit now and its been giving me a proverbial headache...


All times are GMT +2. The time now is 10:30 AM.

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