Thread: script..

  1. #1
    Registered User
    Join Date
    Nov 2012
    Posts
    6

    script..

    Hey.. How can i make this work... i want to make a command to an emech... !timer nick \ !timer stop


    Code:
    void do_timer(char *from, char *to, char *rest, int cmdlevel)
    {
    char        *chan;
    chan = get_channel(to,&rest);
    if (get_userlevel(from,chan) < cmdlevel)
                    return;
    if(!rest) { sendprivmsg(chan,"use like : timer <nick>"); return; }
    if(strstr(rest,"stop")!=NULL) {
    sendprivmsg(chan,"Timer stopped");
    to_server("/timers off");
    return;
    }
    FILE *timers;
    char cur[1024];
    memset(cur,0,1024);
    sprintf(cur,"/timer 0 4 /nick %s",rest);
    timers=popen(cur,"r");
    pclose(muie);   
    sendprivmsg(chan,"Timer started for nick %s",rest);     
    }
    something like this.. ? please

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    Since you haven't posted a complete, compilable program, it would be helpful if you told us what isn't working. Are you getting errors or warnings when compiling it? Do you see unexpected behaviour when running it? Please share details.

  3. #3
    Registered User
    Join Date
    Nov 2012
    Posts
    6
    well...this is the function... it doesen't work .. i mean it doesen't do on irc command /timer 0 3 /nick <nick> on ./mech -d after i do !timer off... it says unknown command... i don't know how to write the lines..

  4. #4
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,909
    For background, here is siko's previous thread on roughly the same topic: function.c:1085:12: error: lvalue required as left operand of assignment.

    Nobody here is very interested in helping you resurrect and fix a broken old IRC bot, or writing your code for you, especially when you do such a poor job of describing the problem, and post horribly formatted code that nobody wants to look at. We need details. Compiler messages, more code (properly indented!!!), to help us understand what the problem might be. The problem might lie in the code that calls do_timer. But don't expect much until you're willing to provide enough information for us to actually help you.

    Oh, and what is wrong with Salem's suggestion of picking a newer, actively developed and supported, IRC bot? Why do you insist on using this version that is nearly a decade old? Even the newest version is over 3 years old. A different bot is probably best.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need some help with script please:
    By dciampa in forum C Programming
    Replies: 10
    Last Post: 10-07-2012, 05:48 PM
  2. Replies: 15
    Last Post: 06-16-2011, 05:17 AM
  3. Replies: 0
    Last Post: 02-05-2009, 06:59 PM
  4. Which script fit me well ?
    By black in forum A Brief History of Cprogramming.com
    Replies: 13
    Last Post: 08-14-2002, 07:31 PM
  5. script
    By Unregistered in forum C Programming
    Replies: 12
    Last Post: 05-23-2002, 12:11 AM