Author Topic: Coding  (Read 8393 times)

0 Members and 1 Guest are viewing this topic.

DeathAdder

  • Orc Thrasher
  • ***
  • Posts: 137
  • Reputation: +0/-0
    • http://www.los.planetubh.com
Coding
« on: November 15, 2003 12:52 am CST »
Hey, none of you seem to inclined to help me get a GetWord(); thing working so i was wondering if anyone knew of a site or something that can help??. Unless someone out there IS willing to help me?. Thank you.
« Last Edit: December 31, 1969 06:00 pm CST by DeathAdder »
<img src="http://www.pcrpg.org/pics/hosted/dadder.jpg">

Particle

  • Chief Codemonger
  • Administrator
  • Centurian Lord
  • ********
  • Posts: 5,904
  • Reputation: +20/-4
    • Particle's Custom RPG
(No subject)
« Reply #1 on: November 15, 2003 07:03 am CST »
This is the first I've heard about it.  Give us some details.
« Last Edit: December 31, 1969 06:00 pm CST by Particle »
As a point of history:  Our last server clear was on September 27, 2004.  That is 4963 days ago (13.6 years) as of today.

If you're visiting after a long hiatus and have forgotten your password, try emailing me via the support form at http://www.pcrpg.org.

If your character is from after the 2004 clear but appears to have been deleted or reset, chances are it was caught in one of the inactive account purges over the years.  Backups were made before such events, so try the support form.

-eViL-

  • Minotaur Rager
  • ******
  • Posts: 880
  • Reputation: +0/-0
(No subject)
« Reply #2 on: November 15, 2003 09:28 am CST »
yea, seriously, I haven't heard a thing about it and i'll help with it...
« 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

DeathAdder

  • Orc Thrasher
  • ***
  • Posts: 137
  • Reputation: +0/-0
    • http://www.los.planetubh.com
(No subject)
« Reply #3 on: November 19, 2003 02:06 pm CST »
OK sorry bout that, well start anew. Heh. Well all i want is to be able to use the getword(); thingy top grab a name from something that my bot sais or i say through a quest script. That will allow me to use that name for mutiple events. If its possible to make someones name carry through multiple blocks i'd like to know until than i'd like to know about the getowrd thing anyways.

I've done some fooling arround with it and i havn't gotten anywhere. All i can do is grab words from doing a getwordfunc(%word) where i grab whatever word in the sentence i type in that. But i couldn't get words from strings that ppl say in the chat box. I tried making a variable = the first word in the sentance and that didn't work:\ i looked at lots examples like in comchat.cs and i tried to make a connection where thier string::NEWgetsubstr(); thing might have been the thing i'd use to grab strings and look for the first word. Tried that, didn't work.

Pretty much i'm stuck. Id post some code where i did some examples but i'm at school. Sorry for takinga  while to answer, heh i check my mail once a week and like i forgot about this post ^_^ Thanx for the offer to help I hope i can get this working.
« Last Edit: December 31, 1969 06:00 pm CST by DeathAdder »
<img src="http://www.pcrpg.org/pics/hosted/dadder.jpg">

-eViL-

  • Minotaur Rager
  • ******
  • Posts: 880
  • Reputation: +0/-0
(No subject)
« Reply #4 on: November 19, 2003 03:31 pm CST »
Code: [Select]
function onClientMessage(%client, %msg)
{
for(%word=0; %word <= 5; %word++)
%Word[%word] = getWord(%msg, %word);

return true;
}


that would set %Word[0] through %Word[5] using the first words from a message sent to you.
« 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

DeathAdder

  • Orc Thrasher
  • ***
  • Posts: 137
  • Reputation: +0/-0
    • http://www.los.planetubh.com
(No subject)
« Reply #5 on: November 19, 2003 04:04 pm CST »
WOW.... Ok so lets say i want to get a name from a global message like....
[GLBL] Bot "Well done Ian, nice work"
so to grab ian would i use getword(%msg, 4); cause the [GLBL] is 0, bot is 1, "well is 2, done 3, ian 4, nice 5, work 6,.... well with your %word setting the word from 1 to 5 what did you mean?
« Last Edit: December 31, 1969 06:00 pm CST by DeathAdder »
<img src="http://www.pcrpg.org/pics/hosted/dadder.jpg">

-eViL-

  • Minotaur Rager
  • ******
  • Posts: 880
  • Reputation: +0/-0
(No subject)
« Reply #6 on: November 19, 2003 04:45 pm CST »
that function... everytime you get a message, it will sort the message out into parts... the first 6 parts....

%Word[0] = getWord(%msg, 0);
%Word[1] = getWord(%msg, 1);
%Word[2] = getWord(%msg, 2);
%Word[3] = getWord(%msg, 3);
%Word[4] = getWord(%msg, 4);
%Word[5] = getWord(%msg, 5);

that loop i put in there basically does that... so it divides the sentence up for you..
« 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

DeathAdder

  • Orc Thrasher
  • ***
  • Posts: 137
  • Reputation: +0/-0
    • http://www.los.planetubh.com
(No subject)
« Reply #7 on: November 19, 2003 10:44 pm CST »
Assuming that does that for EVERY thing that comes up in the chat box i'd just start counting and doing if(%word[3] == "Bot") lets say checking for the name and than after that go into the %word[5] = %name; for the specific name i want and than i can start using %name for other things as long as the message its grabbing is from that specific scentence. I could always do 2 ifs to ensure that the sentence i want is the one it gets the name from. i can organize it. I hope i'm assuming right :\

Also if i wanted to make messages not appear like loadout defined and demon already exists, *plain white messages* how would i do it. Like if (this message appears) echo blah *so it only sppears in consol not chat box* return true; something like that, i dunno. Any ideas?
« Last Edit: December 31, 1969 06:00 pm CST by DeathAdder »
<img src="http://www.pcrpg.org/pics/hosted/dadder.jpg">

-eViL-

  • Minotaur Rager
  • ******
  • Posts: 880
  • Reputation: +0/-0
(No subject)
« Reply #8 on: November 20, 2003 02:08 pm CST »
Code: [Select]
function onClientMessage(%client, %msg)
{
for(%word=0; %word <= 5; %word++)
%Break[%word] = getWord(%msg, %word);

%Name = %Break[1];

if(String::findSubStr(%msg, "Loadout already defined.") != -1)
{
echo("Loadout Already Defined.");
return false;

// returning false makes it not show up in chat.
}

return true;
}
« 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

DeathAdder

  • Orc Thrasher
  • ***
  • Posts: 137
  • Reputation: +0/-0
    • http://www.los.planetubh.com
(No subject)
« Reply #9 on: November 20, 2003 11:16 pm CST »
Hey, Thanx so much you really hellped, I can do what i need now. Only one thing i'm not sure if you know how or if its possible but I'm sure you can actually get letters with in words.. like how # is grabbed in comchat.cs and that so i used your for(%word blah) to do a %sylible where %letter[%sylible] = String::getSubStr(%msg, %Break[3], %Letter[3]) all that, had no errors only didn't work.. I have some more testing to do but if you know how that might be faster. Thanx again for all the help.
« Last Edit: December 31, 1969 06:00 pm CST by DeathAdder »
<img src="http://www.pcrpg.org/pics/hosted/dadder.jpg">

-eViL-

  • Minotaur Rager
  • ******
  • Posts: 880
  • Reputation: +0/-0
(No subject)
« Reply #10 on: November 21, 2003 02:56 pm CST »
Code: [Select]
%Start = 0;  %Finish = 1;
%Letter = String::getSubStr(%Break[%Choice], %Start, %Finish);
« 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

DeathAdder

  • Orc Thrasher
  • ***
  • Posts: 137
  • Reputation: +0/-0
    • http://www.los.planetubh.com
(No subject)
« Reply #11 on: December 26, 2003 10:52 pm CST »
Hey ppl I'm back and need some more help ^_^. Now I want to know if it's possible to get the zone someones in. Like have a script check for the zone someones in than if thier in a cirtain zone have the script do something. When someone i have on a list enters the zone i'm in I want it to tell me they came in pretty much... Any help? Thanks
« Last Edit: December 31, 1969 06:00 pm CST by DeathAdder »
<img src="http://www.pcrpg.org/pics/hosted/dadder.jpg">

DeadBreed

  • Elvin Legion
  • *****
  • Posts: 480
  • Reputation: +0/-0
(No subject)
« Reply #12 on: December 27, 2003 07:25 am CST »
ok i need help now too :-\

i have 2 files which are basically autoexec but,  i want to make em run seperately: one runs if i run rpg, the other runs if i run normal tribes.

my files are called rpgexec.cs and normexec.cs

oh yeah how do i fix deuspack on the part where it says im not running
-mod rpg
« Last Edit: December 31, 1969 06:00 pm CST by DeadBreed »
Agent556, out.


UnderGod

  • Centurian Lord
  • ********
  • Posts: 2,691
  • Reputation: +0/-0
(No subject)
« Reply #13 on: December 27, 2003 07:50 am CST »
Quote from: "DeadBreed"
oh yeah how do i fix deuspack on the part where it says im not running
-mod rpg


run it -mod rpg

The easiest thing for you is to have tribes installed twice.. One for base, One for TRPG.
« 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"

DeathAdder

  • Orc Thrasher
  • ***
  • Posts: 137
  • Reputation: +0/-0
    • http://www.los.planetubh.com
(No subject)
« Reply #14 on: December 27, 2003 12:26 pm CST »
Any ideas on my problem?.....:(
« Last Edit: December 31, 1969 06:00 pm CST by DeathAdder »
<img src="http://www.pcrpg.org/pics/hosted/dadder.jpg">