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
mervbot banner code

 
Post new topic   Reply to topic Printable version
 View previous topic  Plugin won't load for other people (Me... Post :: Post need bot plugin for mervbot  View next topic  
Author Message
Underlord
Novice


Gender:Gender:Male
Joined: Feb 17 2004
Posts: 55
Offline

PostPosted: Tue Jan 27, 2009 1:16 am    Post subject: mervbot banner code Reply to topic Reply with quote

Mervbot code for the bot to grab player's banners and save them in .bmp files. You could save these in a web folder then load em easily on a website like http://stats.svszone.com . Doesn't work to do this code on playerentering event, I know playerleaving works. Needs template.bmp from continuum/banners in the bot folder.

Code: Show/Hide

// needs fstream
char buffer[1174];
char filename[99];
int x,y = 0;
bool is_blank = true;

strcpy(filename,p->name);
strncat(filename,".bmp",5);

ifstream is("template.bmp", ios::binary);
is.read(buffer, 1174);
is.close();

for(y = 0; y < 8; y++)
   for(x = 0; x < 12; x++)
   {
      buffer[1078+y*12+x] = p->banner[((7-y)*12)+x];

      if (p->banner[((7-y)*12)+x] != 0)
         is_blank = false;
   }

if (!is_blank)
{
   ofstream os(filename, ios::binary);
   os.write(buffer, 1174);
   os.close();
}


some sample php code to display them

Code: Show/Hide

<?php
$filename = "playerbanners//" .$row['player_name']. ".bmp";
                  
if (file_exists($filename))
   echo "<img src='" . $filename . "' width=12 height=8>";
?>


thx to DeathOnline for help getting it working

works in subgame and asss

hope this is useful to someone
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: 66 page(s) served in previous 5 minutes.

phpBB Created this page in 0.079993 seconds : 25 queries executed (69.4%): GZIP compression disabled