Author Topic: Need help making a simple script.  (Read 8219 times)

0 Members and 1 Guest are viewing this topic.

-eViL-

  • Minotaur Rager
  • ******
  • Posts: 880
  • Reputation: +0/-0
(No subject)
« Reply #15 on: June 3, 2004 06:51 pm CDT »
Code: [Select]
$Train1 = false;
$Train2 = false;
$T = true;

function Train(%Opt)
{
if($T)
{
if(Fetch("MANA") == 0)
{
echo("Meditate");
say(0, "#meditate");
schedule::Add("say(0, \"#meditate\");", 3, SayMed);
Train::Meditate();
schedule::Add("Train::Meditate();", 3, TrainMeditate);
}

if(%Opt == 0)
{
schedule::Cancel(TrainWeapon);
schedule::Cancel(TrainWeight);
return;
}
else if(%Opt == 1)
{
$Action = 1;
schedule::Cancel(TrainMedWeapon);
$Train1 = true;
postAction(2048, IDACTION_BREAK1, 0);
schedule::Add("Train(1);", 1.8, TrainWeapon);
}
else if(%Opt == 2)
{
$Action = 1;
schedule::Cancel(TrainMedWeight);
$Train2 = true;
postAction(2048, IDACTION_MOVEUP, 1);
schedule::Add("Train(2);", 0.1, TrainWeight);
}
}
}

function Train::Meditate()
{
$Action = 2;
$T = false;
schedule::Add("Train::Meditate();", 2, TrainMeditate);

if(Fetch("MANA") == 100)
{
echo("Wake Up.");
say(0, "#wake");
schedule::Add("say(0, \"#wake\");", 3, SayWake);
schedule::Cancel(TrainMeditate);
$T = true;

if($Train1)
{
Train(1);
schedule::Add("Train(1);", 3, TrainMedWeapon);
}

if($Train2)
{
Train(2);
schedule::Add("Train(2);", 3, TrainMedWeight);
}
}
}

function TrainOff()
{
$T = false;
schedule::Cancel(TrainWeapon);
schedule::Cancel(TrainWeight);
}
« Last Edit: December 31, 1969 06:00 pm CST by -eViL- »
There's nothing ever wrong but nothing's ever right
Such a cruel contradiction

Newbie

  • Spam Specialist
  • Centurian Lord
  • Posts: 2,531
  • Reputation: +1/-0
    • http://imchaos.com/newl.asp?x=M0ckious&y=900627
(No subject)
« Reply #16 on: June 3, 2004 07:27 pm CDT »
Thanks, but..

how exactly do I run this command through console?

exec("NameOfFile");  ?
« Last Edit: December 31, 1969 06:00 pm CST by Newbie »

UnderGod

  • Centurian Lord
  • ********
  • Posts: 2,691
  • Reputation: +0/-0
(No subject)
« Reply #17 on: June 3, 2004 10:18 pm CDT »
Put it all in a CS file.. exec the CS file

either bind a command or type Train(%Opt) in console.

If you type 1 in place of %Opt it will swing your weapon while you are meditating.

If you type 2 it will jump while meditating.

If you type 0 it will cancel the above. You will wake when your mana is full.
« Last Edit: December 31, 1969 06:00 pm CST by UnderGod »
"The right man in the wrong place can make all the difference in the world"

Sinister

  • Uber Menace
  • *******
  • Posts: 1,125
  • Reputation: +0/-0
    • http://www.stormpages.com/snowmann69
(No subject)
« Reply #18 on: June 4, 2004 12:33 pm CDT »
Wow, i wish my autogrouping post would have been answered like that.  All i got was a vague referece to GUI's (which i have no idea how to do).  The topic is still open if anyone else would like to help in this.  This is probably the last big thing left before my bot is fully capable of playing the server without a person behind the keyboard.  Wait, no, he cant be summoned directly to a person, so i guess i still have to work on that too.  The script I'm writing is open source.  You can view it on my website.  Http://www.stormpages.com/snowmann69.  Enjoy.
« Last Edit: December 31, 1969 06:00 pm CST by Sinister »

Newbie

  • Spam Specialist
  • Centurian Lord
  • Posts: 2,531
  • Reputation: +1/-0
    • http://imchaos.com/newl.asp?x=M0ckious&y=900627
(No subject)
« Reply #19 on: June 7, 2004 03:31 pm CDT »
Hey Ozz.. it didn't work all the way for me :/

I did everything you told me to.. but once I typed "Train(%Opt)" my character started meditating and wouldn't stop.
« Last Edit: December 31, 1969 06:00 pm CST by Newbie »

UnderGod

  • Centurian Lord
  • ********
  • Posts: 2,691
  • Reputation: +0/-0
(No subject)
« Reply #20 on: June 7, 2004 03:43 pm CDT »
You need to type Train(0); or Train(1); or Train(2); for the options described above.
« Last Edit: December 31, 1969 06:00 pm CST by UnderGod »
"The right man in the wrong place can make all the difference in the world"

-eViL-

  • Minotaur Rager
  • ******
  • Posts: 880
  • Reputation: +0/-0
(No subject)
« Reply #21 on: June 7, 2004 03:59 pm CDT »
no oz.. i forgot to stick in a function.... so it is doing Fetch("MANA") and getting a blank.. which would cause that.


Code: [Select]
function RPGfetchData(%type)
{
if(String::findSubStr($ServerMod, "rpg") != -1)
return remoteEval(2048, fetchData, %type);
}

function remoteSetRPGdata(%server, %data, %type)
{
if(%server == 2048)
$RPGdata[%type] = %data;
}

function fetch(%type)
{
rpgfetchdata(%type);
return $RPGdata[%type];
}


sorry psycho.
« Last Edit: December 31, 1969 06:00 pm CST by -eViL- »
There's nothing ever wrong but nothing's ever right
Such a cruel contradiction

UnderGod

  • Centurian Lord
  • ********
  • Posts: 2,691
  • Reputation: +0/-0
(No subject)
« Reply #22 on: June 7, 2004 10:52 pm CDT »
This is true, but since he said he had deuspack =/
« Last Edit: December 31, 1969 06:00 pm CST by UnderGod »
"The right man in the wrong place can make all the difference in the world"