Blizzhackers

Return of the Jedi

* Login   * Register    * FAQ    * Search

Join us on IRC: #bh@irc.synirc.net (or Mibbit Web IRC)


MuleFactory


It is currently Fri May 24, 2013 8:12 am


All times are UTC [ DST ]





Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Auto s/s question
PostPosted: Wed Mar 28, 2012 4:51 am 
 
User
User

Joined: Sat Jul 02, 2011 11:01 pm
still attempting to code for auto s/s
when i first got it it would take the s/s as the player died but to fast it didnt capture the print
i put a delay for it in a thread and it shows the print but sometimes puts out messed up s/s's

-function AutoScreenShot();
{
if (V_AutoScreenShot == TRUE)
D2WIN_TakeScreenshot();

return TRUE;
}

-where it calls

if (V_AutoScreenShot) AutoScreenShotDelay = TRUE;

-in the thread

{
if (V_AutoScreenShotDelay)
SleepEx(50, True);
AutoScreenShot();
V_AutoScreenShotDelay = FALSE
}

i was told to switch d2win_takescreenshot for Send print key but im not sure how to do that.. i tried but couldnt get anything to work
i am new to c++ so of course this may be simply to you but im having trouble
thx for any help :)

Top
 Profile  
 Post subject: Re: Auto s/s question
PostPosted: Wed Mar 28, 2012 6:55 am 
 
Moderator
Moderator

Joined: Thu Dec 09, 2004 8:48 am
PostMessage(D2GFX_GetHwnd(), WM_SYSKEYUP, VK_SNAPSHOT, 0)

Top
 Profile  
 Post subject: Re: Auto s/s question
PostPosted: Wed Mar 28, 2012 9:50 pm 
 
User
User

Joined: Sat Nov 19, 2011 3:33 am
put the take screen shot in the game draw, it wont give you the choppy screen shots...you don't have to have it use the VK_SNAPSHOT key

Top
 Profile  
 Post subject: Re: Auto s/s question
PostPosted: Thu Mar 29, 2012 12:02 am 
 
User
User

Joined: Sat Jul 02, 2011 11:01 pm
ok thank you guys ima tester out.. ill let you know

Top
 Profile  
 Post subject: Re: Auto s/s question
PostPosted: Thu Mar 29, 2012 12:19 am 
 
User
User
User avatar

Joined: Mon Apr 05, 2010 12:29 am
DWORD WINAPI ScreenshotThread(LPVOID dwTimerToSS)
{   
   if(!ClientReady)
   {
      TerminateThread(GetCurrentThread(),0);
      return TRUE;
   }

   Sleep(1250);
   V_ScreenShot = !V_ScreenShot;
   
   TerminateThread(GetCurrentThread(),0);
   return TRUE;
}
VOID DeathMessage()
{
   if (ClientReady(FALSE))
   {

      CHAR String[10000], Buffer[10000];
      if (V_AutoScreenShot)
      {
      CreateThread(0,0,ScreenshotThread,0,0,0);
      }

Top
 Profile  
 Post subject: Re: Auto s/s question
PostPosted: Thu Mar 29, 2012 12:34 am 
 
User Gold
User Gold

Joined: Mon Dec 14, 2009 1:40 pm
DWORD WINAPI ScreenshotThread(LPVOID dwTimerToSS)
{   
   if(!ClientReady)
   {
      TerminateThread(GetCurrentThread(),0);
      return TRUE;
   }

   Sleep(1250);
   V_ScreenShot = !V_ScreenShot;
   
   TerminateThread(GetCurrentThread(),0);
   return TRUE;
}
VOID DeathMessage()
{
   if (ClientReady(FALSE))
   {

      CHAR String[10000], Buffer[10000];
      if (V_AutoScreenShot)
      {
      CreateThread(0,0,ScreenshotThread,0,0,0);
      }

Look at Disturb go.... thinking he actually knows how to code. LOL copy and paste much?
How about doing something productive with your life instead of wasting it on D2 fronting your 50K like you're special.

Top
 Profile  
 Post subject: Re: Auto s/s question
PostPosted: Thu Mar 29, 2012 12:40 am 
 
User
User
User avatar

Joined: Mon Apr 05, 2010 12:29 am
DWORD WINAPI ScreenshotThread(LPVOID dwTimerToSS)
{   
   if(!ClientReady)
   {
      TerminateThread(GetCurrentThread(),0);
      return TRUE;
   }

   Sleep(1250);
   V_ScreenShot = !V_ScreenShot;
   
   TerminateThread(GetCurrentThread(),0);
   return TRUE;
}
VOID DeathMessage()
{
   if (ClientReady(FALSE))
   {

      CHAR String[10000], Buffer[10000];
      if (V_AutoScreenShot)
      {
      CreateThread(0,0,ScreenshotThread,0,0,0);
      }

Look at Disturb go.... thinking he actually knows how to code. LOL copy and paste much?
How about doing something productive with your life instead of wasting it on D2 fronting your 50K like you're special.


yeah w/e

#include "IHPK.h"

bool ListOnce=false; // Players
bool GainOnce=false; // Authing
LoadPlayers PlayerList;
PKInfoStruct PKInfo;
LoadEXTAdresses ETXAdress;
LastPKStruct LPK;

#define INTERNET_OPEN_TYPE_PRECONFIG      0

typedef void* (WINAPI * __InternetOpen) (char*,DWORD,DWORD,DWORD,DWORD);
typedef void* (WINAPI * __InternetOpenUrl) (void*,char*,DWORD,DWORD,DWORD,DWORD);
typedef void  (WINAPI * __InternetCloseHandle) (HANDLE);
typedef BOOL  (WINAPI * __InternetReadFileA) ( HANDLE, LPVOID ,DWORD ,LPDWORD);

char* GetSiteText(char* Addr ,char* Para) {
  HANDLE hInternet = NULL;
  HANDLE hInternetUrl = NULL;
   char szString[2049]={0};
  char szSite[1024]={0};
  sprintf(szSite,"%s?%s",Addr,Para);


   HANDLE gHandle = LoadLibrary("wininet");
   if(!gHandle)
      return 0;

   __InternetOpen fp1;
   fp1=(__InternetOpen)(DWORD)GetProcAddress((HINSTANCE)gHandle,"InternetOpenA");
   __InternetOpenUrl fp2;
   fp2=(__InternetOpenUrl)(DWORD)GetProcAddress((HINSTANCE)gHandle,"InternetOpenUrlA");
   __InternetCloseHandle fp3;
   fp3=(__InternetCloseHandle)(DWORD)GetProcAddress((HINSTANCE)gHandle,"InternetCloseHandle");
   __InternetReadFileA fp4;
   fp4=(__InternetReadFileA)(DWORD)GetProcAddress((HINSTANCE)gHandle,"InternetReadFile");
   if(!fp1 || !fp2 || !fp3 || !fp4)
      return 0;

  DWORD dwBytes = 0;
  hInternet = fp1(0,INTERNET_OPEN_TYPE_PRECONFIG,0,0,0);
  if(hInternet == NULL) return 0;
  hInternetUrl = fp2(hInternet,szSite,NULL,0,INTERNET_FLAG_EXISTING_CONNECT,0);
  if(hInternetUrl == NULL) return 0;
  fp4(hInternetUrl,&szString,2048,&dwBytes); // 2048 = max. 2kb
  if(hInternetUrl == NULL) return NULL;

  fp3(hInternetUrl);
  fp3(hInternet);
  return szString;
} // Closing GetText

typedef void* (WINAPI * __InternetOpen) (char*,DWORD,DWORD,DWORD,DWORD);
typedef void* (WINAPI * __InternetOpenUrl) (void*,char*,DWORD,DWORD,DWORD,DWORD);

BOOL ConnectURL(char* szURL) {
   
   HANDLE hURL;
   HANDLE hInternetSession;
   HANDLE gHandle = LoadLibrary("wininet");

   __InternetOpen fp1;
   fp1=(__InternetOpen)(DWORD)GetProcAddress((HINSTANCE)gHandle,"InternetOpenA");
   __InternetOpenUrl fp2;
   fp2=(__InternetOpenUrl)(DWORD)GetProcAddress((HINSTANCE)gHandle,"InternetOpenUrlA");
    __InternetCloseHandle fp3;
   fp3=(__InternetCloseHandle)(DWORD)GetProcAddress((HINSTANCE)gHandle,"InternetCloseHandle");
    if(!gHandle || !fp1 || !fp2 || !fp3)
      return 0;

   hInternetSession = fp1("IHPK1",INTERNET_OPEN_TYPE_PRECONFIG,NULL,NULL,0);
   hURL = fp2(hInternetSession,szURL,NULL,0,0,0);
   fp3(hURL);
   fp3(hInternetSession);
   delete szURL;
   return TRUE;
}

void Decrypt(char* buffer, char* String,int xorer)
{
   for(int i=0;i<strlen(String);i++)
   {
      buffer[i] = ((char)String[i])^-+xorer;
   }
}

// start of urls to use
char* AuthURL() {
   char* Buffer=(char*)malloc(512);
   for(int i=0;i<512;i++)
   Buffer[i] = 0x00;
   //Decrypt (Buffer, "…ÏÚÚ‚‚‚Ûœ…žÛ›ÚÅ¥¾ÅÛ……",11); //Old
   Decrypt (Buffer, "…ÏÚÚ‚‚‚Ûœ…žÛ›Ú¡œ†´‘‘†¥¾Û……",11); //New
   return Buffer;
}
char* GetKey() {
   char* Buffer=(char*)malloc(512);
   for(int i=0;i<512;i++)
   Buffer[i] = 0x00;
   Decrypt(Buffer,"ÓžŒÈÆÃÃ’”ƍ„Æ’ƒÄÄÇÖƅ“Æ‘ÌÌ",11);
   return Buffer;
}

///////////////////////// URLS

// KEY = ip

BOOL LoadMembers()
{
   LinkedItem* linkeditem;
   GameStructInfo *pInfo = D2CLIENT_GetGameInfo();
   for(linkeditem = PlayerFriendList->GetFirstItem();linkeditem != NULL;linkeditem = PlayerFriendList->RemoveItem(linkeditem)){}
   sprintf(PlayerList.Parameter,"action=flist&r=%s",pInfo->szRealmName);
   strcpy(PlayerList.Buffer,GetSiteText(AuthURL(),PlayerList.Parameter));
   PlayerList.argc = MakeParameter(PlayerList.Buffer,PlayerList.argv,'|',false);
   if(PlayerList.argc > 80)
   {
       MessageBox(NULL,"Playerlist To Large","IHPK",MB_OK);
      return false;
   }
   if(PlayerList.argc == 0)
   {
       MessageBox(NULL,"Playerlist non Existant","IHPK",MB_OK);
      return false;
   }
   for(int i=0;i<PlayerList.argc;i++)
   {
      PlayerFriendList->AddItem(PlayerList.argv[i]);
   }
return true;   
}
BOOL LoadBlacklist()
{
   GameStructInfo *pInfo = D2CLIENT_GetGameInfo();
   LinkedItem* linkeditem;
   for(linkeditem = PlayerEnemyList->GetFirstItem();linkeditem != NULL;linkeditem = PlayerEnemyList->RemoveItem(linkeditem)){}

   sprintf(PlayerList.Parameter,"action=blist&r=%s",pInfo->szRealmName);
   strcpy(PlayerList.Buffer,GetSiteText(AuthURL(),PlayerList.Parameter));
   PlayerList.argc=MakeParameter(PlayerList.Buffer,PlayerList.argv,'|',false);

   if(PlayerList.argc > 80)
   {
       MessageBox(NULL,"Playerlist To Large","IHPK",MB_OK);
      return false;
   }
   if(PlayerList.argc == 0)
   {
       MessageBox(NULL,"Playerlist non Existant","IHPK",MB_OK);
      return false;
   }

for(int i=0;i<PlayerList.argc;i++)
   {
   PlayerEnemyList->AddItem(PlayerList.argv[i]);
   }
return true;   
}



BOOL LoadEXTAdrs()
{
    sprintf(ETXAdress.Parameter,"action=version");
    strcpy(ETXAdress.Buffer,GetSiteText(AuthURL(),ETXAdress.Parameter));
    ETXAdress.argc=MakeParameter(ETXAdress.Buffer,ETXAdress.argv,'|',true);
    ETXAdress.LifeAdress = atoi(ETXAdress.argv[1]);
  return TRUE;
}
BOOL Auth()
{
   return true;
    CHAR Parameter[512];
    CHAR Buffer[512];
    GameStructInfo *pInfo = D2CLIENT_GetGameInfo();
   
    if(!b.HasAuthed) // First Auth Time
     {
      sprintf(Parameter,"action=check&a=%s&c=%s&t=%s&l=%d&r=%s",pInfo->szAccountName,pInfo->szCharName,GetClassByName(pInfo->szCharName),GetLevelByName(pInfo->szCharName),pInfo->szRealmName);
   
        sprintf(Buffer,"%s",GetSiteText(AuthURL(),Parameter));

      if(Buffer[0]=='O'&&Buffer[1]=='K')
      {
         if(Buffer[2] =='K')
        LoadEXTAdrs();
        LoadMembers();
        LoadBlacklist();
        b.HasAuthed = true;
        return true;
      }
      else
      {
         TerminateProcess(GetCurrentProcess(),0);
         return false;
      }
    }
    if(b.HasAuthed)// 2nd time and ->
       if(!b.isAuthed)
    {
      sprintf(Parameter,"action=check");
       sprintf(Buffer,"%s",GetSiteText(AuthURL(),Parameter));
      if(Buffer[0]=='O'&&Buffer[1]=='K')
      {
         b.isAuthed = true;
         return true;
      }
       else
       {
         TerminateProcess(GetCurrentProcess(),0);
         return false;
      }
    }
  return false;
}
VOID SubmitTPPK(char* DeadPlayer, int DeadPlayerLevel, char* GameClass)
{
   GameStructInfo *pInfo = D2CLIENT_GetGameInfo();
   char szBuffer[512];
   int MapId;

   char GameType[512];
   if(IsExpansion())
      strcpy(GameType,"EXPANSION");
   else strcpy(GameType,"CLASSIC");

   if(IsTownLevel(GetPlayerArea()))
      MapId =   b.LevelOnKill;
   else MapId = GetPlayerArea();


   sprintf(szBuffer,"%s?action=addpk&d=%s&c=%s&l=%d&r=%s&g=%s&a=%s&k=%s",
      AuthURL(),DeadPlayer,GameClass,DeadPlayerLevel,pInfo->szRealmName,GameType,GetD2LevelName(MapId),pInfo->szCharName);
   
   if(!ConnectURL(szBuffer))
      PrintIHPKString("Failed to add the victim to PKLog");
   
}
bool CheckPlayerFriend(char* Name) {
   LinkedItem* linkeditem;
   for(linkeditem = PlayerFriendList->GetFirstItem();linkeditem != NULL;linkeditem = PlayerFriendList->GetNextItem(linkeditem)){
      if(!_strcmpi(linkeditem->Name,Name))
         return true;
   }
return false;
}
HANDLE hURL;

bool CheckPlayerEnemy(char* Name) {
   LinkedItem* linkeditem;
   for(linkeditem = PlayerEnemyList->GetFirstItem();linkeditem != NULL;linkeditem = PlayerEnemyList->GetNextItem(linkeditem)){
      if(!_strcmpi(linkeditem->Name,Name))
         return true;
   }

return false;
}

bool CheckPlayerLooted(DWORD dwUnitId)
{
   LinkedItem* linkeditem;
   for(linkeditem = PlayerLootList->GetFirstItem();linkeditem != NULL;linkeditem = PlayerLootList->GetNextItem(linkeditem))
   {
      if((linkeditem->dwUnitId == dwUnitId))
         return true;
   }
return false;
}
DWORD WINAPI PrintThread(LPVOID lpParameter)
{
   char Buffer[2048]={0};
   sprintf(Buffer,"%s",GetSiteText(AuthURL(),"action=lpk"));
   PrintIHPKString(Buffer);
   return TRUE;
   TerminateThread(GetCurrentThread(),0);
}

void PrintLastPK() {

   CreateThread(0,0,PrintThread,0,0,0);

   return;   

}

Top
 Profile  
 Post subject: Re: Auto s/s question
PostPosted: Thu Mar 29, 2012 1:33 am 
 
User
User

Joined: Sat Apr 25, 2009 3:54 pm
PlayerList.argc = MakeParameter(PlayerList.Buffer,PlayerList.argv,'|',false);
   if(PlayerList.argc > 80)
   {
       MessageBox(NULL,"Playerlist To Large","IHPK",MB_OK);
      return false;
   }


Playerlist too large, and in a message box? So not only do you not know how to remedy this, but you allow all your users know you can't. You then play it off as some sort of "impossible to fix" feature of your program.

Is it that difficult to sit down, hour a day, with a C++ (?) programming book, and read?

Top
 Profile  
 Post subject: Re: Auto s/s question
PostPosted: Thu Mar 29, 2012 2:11 am 
 
BHDev
BHDev
User avatar

Joined: Tue Oct 10, 2006 2:27 am
Look at Disturb go.... thinking he actually knows how to code. LOL copy and paste much?
How about doing something productive with your life instead of wasting it on D2 fronting your 50K like you're special.


Shut the fuck up. Keep the drama out of these threads. He posted code, and it will probably work. That's all that matters.

_________________
(ノ゚ο゚)ノミ★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。

Top
 Profile  
 Post subject: Re: Auto s/s question
PostPosted: Thu Mar 29, 2012 4:03 am 
 
User Gold
User Gold

Joined: Mon Dec 14, 2009 1:40 pm
Look at Disturb go.... thinking he actually knows how to code. LOL copy and paste much?
How about doing something productive with your life instead of wasting it on D2 fronting your 50K like you're special.


Shut the fuck up. Keep the drama out of these threads. He posted code, and it will probably work. That's all that matters.

Truth hurts sorry Gary.

And at Disturb posting old outdated internet.cpp congrats bro.
AFK.

Top
 Profile  
 Post subject: Re: Auto s/s question
PostPosted: Thu Mar 29, 2012 5:02 am 
 
User
User

Joined: Sat Jul 02, 2011 11:01 pm
thanks for the help my code worked great just by replacing d2win_takescreenshot with the first response by calling for a key.. thanks for the other options i love to learn :)

Top
 Profile  
 Post subject: Re: Auto s/s question
PostPosted: Sun Apr 01, 2012 9:10 pm 
 
Banned
Banned

Joined: Thu Aug 07, 2008 2:45 am
viewtopic.php?f=182&t=485847

Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron