Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Sighage with bot vars.

 
Post new topic   Reply to topic Printable version
 View previous topic  SOS, ur plugins Post :: Post struct BotEvent contents explanation  View next topic  
Author Message
ExplodyThingy
Server Help Squatter


Age:37
Gender:Gender:Male
Joined: Dec 15 2002
Posts: 528
Location: Washington DC
Offline

PostPosted: Wed Jan 08, 2003 11:20 am    Post subject: Sighage with bot vars. Reply to topic Reply with quote

p->name
Im trying to make a trivia type bot and need to isolate thier names.
I know that to capture a message in a string its
Code: Show/Hide
String s =msg;
If(s == FunkyVarName){}

but will that work with p->name?

Separtately, how do i do something like capture line 5 from a 30 line text file and store it to a string. Then, capture line 5 from another text file and compare it to msg. Like trivia with a question.txt and answer.txt

Keep in mind im in a bit of a hurry while typing this, so it may not be clear, am not infront of my code, and i am new to C++.
_________________
There are no stupid question, but there are many inquisitive idiots.
Loot

Dr Brain> I hate clean air and clean water. I'm a member of Evil Conservitive Industries
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
SOS
Server Help Squatter


Joined: Dec 02 2002
Posts: 329
Offline

PostPosted: Wed Jan 08, 2003 12:30 pm    Post subject: Reply to topic Reply with quote

1) You mean if p->name is the FunkyVarName? Yes, p->name is a char[] string, so Catid's String class will work with it
If you mean p->name as the one on the left, then no.
2) You just have to read every line and count how many you have read until you reach the number you want.
_________________
3y3 4m l33t h4x0r
j0! 3y3 4m t4lking to j00!
fux0red 5cr1pt k1dd13.
-"l33t h41ku"
Back to top
View users profile Send private message Add User to Ignore List Send email
ExplodyThingy
Server Help Squatter


Age:37
Gender:Gender:Male
Joined: Dec 15 2002
Posts: 528
Location: Washington DC
Offline

PostPosted: Wed Jan 08, 2003 5:50 pm    Post subject: Reply to topic Reply with quote

Drat.
k. Uh,
Code: Show/Hide
if(x){
String answer = "RandomText";
}
if(PlayerAnswer == answer){}

The complier gives error to the second "answer", says undeclared identifier. Does this mean that i didnt set the variable "answer" as a gloabal var? how do i do that from within one of the switch case{} things in the file

(Im not asking for a "how to write a plugin tutorial", and im trying to not end up doing that, im just baffeled by a few things, and i cant find any decent web resource that explaines these.)
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:40
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3614
Location: Las Vegas
Offline

PostPosted: Wed Jan 08, 2003 5:54 pm    Post subject: Reply to topic Reply with quote

Whenever you declare a variable inside a {}, it is only valid inside that. To do what you want, you need to do the following:

Code: Show/Hide
String answer = "";
if(x){
  answer = "RandomText";
}
if(PlayerAnswer == answer){}
Back to top
View users profile Send private message Add User to Ignore List Send email
ExplodyThingy
Server Help Squatter


Age:37
Gender:Gender:Male
Joined: Dec 15 2002
Posts: 528
Location: Washington DC
Offline

PostPosted: Wed Jan 08, 2003 6:00 pm    Post subject: Reply to topic Reply with quote

Gracias you 2.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:40
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3614
Location: Las Vegas
Offline

PostPosted: Wed Jan 08, 2003 6:05 pm    Post subject: Reply to topic Reply with quote

Just remember to not do a string check if you don't want an answer. Otherwise someone could figure out a way to beat the system, and do things like sending a blank message that may screw up your bot. Yes, people do find ways to break things (i love bre.. i mean, debugging other people's things).
Back to top
View users profile Send private message Add User to Ignore List Send email
ExplodyThingy
Server Help Squatter


Age:37
Gender:Gender:Male
Joined: Dec 15 2002
Posts: 528
Location: Washington DC
Offline

PostPosted: Fri Jan 10, 2003 4:01 pm    Post subject: Reply to topic Reply with quote

mmk.
would this help take care of a few of those?
Code: Show/Hide
if(PlayerAnswer == "" || PlayerAnswer == " ") break;


[edit: stupid question, heh]

[edit: figured it out. Nice little website at http://www.dueling.net/bots/ ]
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Splody; Too lazy to login
Guest


Offline

PostPosted: Sun Jan 19, 2003 10:19 pm    Post subject: Reply to topic Reply with quote

How do i find if someone is i spec?
Ive cant really seem to find something coherent in the others. something like
Code: Show/Hide
If(p->ship == spec) break;

do i have to use those funky player tag things that the rampage bot uses? If so, how?
Back to top
SOS
Server Help Squatter


Joined: Dec 02 2002
Posts: 329
Offline

PostPosted: Sun Jan 19, 2003 11:42 pm    Post subject: Reply to topic Reply with quote

if (p->ship == SHIP_Spectator)
Back to top
View users profile Send private message Add User to Ignore List Send email
ExplodyThingy
Server Help Squatter


Age:37
Gender:Gender:Male
Joined: Dec 15 2002
Posts: 528
Location: Washington DC
Offline

PostPosted: Fri Jan 31, 2003 4:55 pm    Post subject: Reply to topic Reply with quote

Ok, i suppose that works with SHIP_warbird and SHIP_lancaster and such?

And:
lets say i have command !pm [name] how do i convert c->final into whatever i need so i can do sendPrivate(c->final, "Someone says HI!");

Thanks in advance for putting up with my stupidity and all the other questions ive had.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Rifle
Guest


Offline

PostPosted: Fri Jan 31, 2003 6:47 pm    Post subject: Reply to topic Reply with quote

Ok, i suppose that works with SHIP_warbird and SHIP_lancaster and such?

Yup.

-Rifle
Back to top
SOS
Server Help Squatter


Joined: Dec 02 2002
Posts: 329
Offline

PostPosted: Sat Feb 01, 2003 4:12 am    Post subject: Reply to topic Reply with quote

Quote:
lets say i have command !pm [name] how do i convert c->final into whatever i need so i can do sendPrivate(c->final, "Someone says HI!");


String s;
s = "Someone says ";
s += c->final;

ez
Back to top
View users profile Send private message Add User to Ignore List Send email
Dr Brain
Flip-flopping like a wind surfer


Age:38
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Sat Feb 01, 2003 9:59 am    Post subject: Reply to topic Reply with quote

Heh, sos, thats what I thought, then I re-read the post.
_________________
Hyperspace Owner

Smong> so long as 99% deaths feel lame it will always be hyperspace to me
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
SOS
Server Help Squatter


Joined: Dec 02 2002
Posts: 329
Offline

PostPosted: Sat Feb 01, 2003 11:12 am    Post subject: Reply to topic Reply with quote

Oh sa_tongue.gif
Well.... just iterate through the list and compare
Back to top
View users profile Send private message Add User to Ignore List Send email
ExplodyThingy
Server Help Squatter


Age:37
Gender:Gender:Male
Joined: Dec 15 2002
Posts: 528
Location: Washington DC
Offline

PostPosted: Sat Feb 01, 2003 4:30 pm    Post subject: Reply to topic Reply with quote

Right, the question was asking how to send a pm to c->final, not how to make a message with the text c->final in it.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Bot Questions All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 670 page(s) served in previous 5 minutes.

phpBB Created this page in 0.593792 seconds : 40 queries executed (77.3%): GZIP compression disabled