Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Created By Rusu Andrei Robert
- Robert1995
- */
- #include <iostream>
- #include <fstream>
- #include <windows.h>
- #include <string>
- using namespace std;
- char cmdtype[3],cmd[1000],ex[1000],order[3];
- char alias[1000][100][100];
- int she,i,mact,macl,i2;
- int alias_ex(char trac[3]){
- int i,ict;
- for(i=1;i<=mact;i++){
- if(stricmp(cmd,alias[i][0])==0){
- for(ict=1;alias[i][ict]!="end";ict++){
- ShellExecute(NULL, "open", alias[i][ict] ,NULL, NULL, SW_SHOWNORMAL);
- }
- }
- }
- return 0;
- }
- fstream fin("data.txt",ios::in);
- int main(){
- cout<<"Load Macros ? ";
- cin>>order;
- if(stricmp(order,"yes")==0){
- cout<<"Loading ";
- fin>>mact;
- for(i=1;i<=mact;i++){
- cout<<"*";
- fin>>macl;fin>>alias[i][0];
- for(i2=1;i2<=macl;i2++){
- fin>>alias[i][i2];
- }
- fin.get();
- strcpy(alias[i][i2],"end");
- }
- cout<<endl;
- cout<<"Macro's Loaded ! "<<endl;
- }
- while(cin>>cmdtype>>cmd){
- strcpy(ex,"");
- if(stricmp(cmdtype,"url")==0){
- she=1;
- if(!strstr(cmd,"http://")){
- strcpy(ex,"http://");
- strcat(ex,cmd);
- }
- }
- else if(stricmp(cmdtype,"prg")==0){
- she=1;
- strcpy(ex,cmd);
- }
- else if(stricmp(cmdtype,"sys")==0){
- she=0;
- if(stricmp(cmd,"exit")==0) return 0;
- if(stricmp(cmd,"macro")==0) {cin>>cmd;alias_ex(cmd);}
- }
- cout<<"Executing: "<<cmdtype<<" "<<ex<<endl;
- if(she) ShellExecute(NULL, "open", ex ,NULL, NULL, SW_SHOWNORMAL);
- }
- fin.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment