Particle's Custom RPG
Assistance => Assistance & Feedback => Topic started by: Newbie on May 18, 2004 08:38 pm CDT
-
Ok.. I need a script that makes me swing my weapon every ten seconds.. (aka backstab training. It's a differnt mod from tRPG so please don't say "AWW why don't you just use auto swing?!?!?")
I need a script that I can run through console on server. All I need it to do is to simply swing every ten seconds.. anyone help me? Please?
-
Try this for starters..
function fire()
{
postAction(2048, IDACTION_FIRE1);
schedule("postAction(2048, IDACTION_BREAK1);", 0.2);
schedule("fire()", 10);
}
-
actually oz.. it is simpler to just do
function BST()
{
postAction(2048, IDACTION_BREAK1, 0);
schedule("BST();", 10);
}
because sometimes if you do fire and then break, the break will actually cause you to swing... and therefore offsets whatever it is trying to do, or in some cases, the break just won't do anything at all and fire will be left on. so what i have above is by far more efficient and safer.
-
Thanks guys.
-
Uhh.. actually neither of them work..
I saved it in notepad as "Backstab.cs" and ran it in console and neither of them do anything.. it just says it's executing backstab.cs and then nothing happens. :/
-
You need to call the function once to start the loop.
so type fire(); in my case BST(); in eViL's.
-
Kickass, thanks guys.
-
put the first one on a keybind so you dont have to type it in every time you want to instaciate it.
Just a thought.
-
Let us know if you got it to work.
-
Kickass, thanks guys.
Yes he did.
-
Also.. anyone know how to make a script to #meditate every 15 seconds or so?
Any help would be appreciated, thanks.
-
Also.. anyone know how to make a script to #meditate every 15 seconds or so?
Any help would be appreciated, thanks.
You'd need it to #wake too, and you'd need to determine when to do those things.
Some more scheduling......
-
Well, i will work on it when i get home....seems pretty simple, but probably by the time i get to it, someone else will have already answered it. Btw why do you want a script that does that? I may have some stuff you might like instead. Just let me know what it's for.
-
Well it's for TVT and you can't use deuspack because energy involes stamina and walking.. so it doesn't work for some reason..
I just need a script to #meditate to full energy/stamina then #wake and wait about 15 seconds before repeating the process over again.
-
*Bump*
-
$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);
}
-
Thanks, but..
how exactly do I run this command through console?
exec("NameOfFile"); ?
-
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.
-
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 (http://Http://www.stormpages.com/snowmann69). Enjoy.
-
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.
-
You need to type Train(0); or Train(1); or Train(2); for the options described above.
-
no oz.. i forgot to stick in a function.... so it is doing Fetch("MANA") and getting a blank.. which would cause that.
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.
-
This is true, but since he said he had deuspack =/